comboBoxPop.htm 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title></title>
  5. <link href="../../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  6. <style type="text/css">
  7. </style>
  8. <script src="../../lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  9. <script src="../../lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  10. <script src="../../lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
  11. <script src="../../lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  12. <script src="../../lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
  13. <script src="../../lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  14. <script src="../../lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
  15. <script type="text/javascript">
  16. $(function ()
  17. {
  18. $("#txtContactName").ligerComboBox({
  19. onBeforeOpen: f_selectContact, valueFieldID: 'hidCustomerID',width:300
  20. });
  21. });
  22. function f_selectContact()
  23. {
  24. $.ligerDialog.open({ title: '选择联系人', name:'winselector',width: 700, height: 300, url: 'SelectContact.htm', buttons: [
  25. { text: '确定', onclick: f_selectContactOK },
  26. { text: '取消', onclick: f_selectContactCancel }
  27. ]
  28. });
  29. return false;
  30. }
  31. function f_selectContactOK(item, dialog)
  32. {
  33. var fn = dialog.frame.f_select || dialog.frame.window.f_select;
  34. var data = fn();
  35. if (!data)
  36. {
  37. alert('请选择行!');
  38. return;
  39. }
  40. $("#txtContactName").val(data.CompanyName+","+data.ContactName);
  41. $("#hidCustomerID").val(data.CustomerID);
  42. dialog.close();
  43. }
  44. function f_selectContactCancel(item, dialog)
  45. {
  46. dialog.close();
  47. }
  48. function clickee()
  49. {
  50. alert($("#hidCustomerID").val());
  51. }
  52. </script>
  53. </head>
  54. <body style="padding:10px">
  55. <input type="text" id="txtContactName" />
  56. <input type="hidden" id="hidCustomerID" />
  57. <br />
  58. <a href="javascript:clickee()" class="l-button" style="width:100px">获取</a>
  59. <br /><br /><br /><br />
  60. <div style="display:none;">
  61. <!-- g data total ttt -->
  62. </div>
  63. </body>
  64. </html>