bc45903580571abd5d89a617958d632b29f7d5a0.svn-base 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>ComboGrid Actions - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>ComboGrid Actions</h2>
  14. <p>Click the buttons below to perform actions.</p>
  15. <div style="margin:20px 0">
  16. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="getValue()">GetValue</a>
  17. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="setValue()">SetValue</a>
  18. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="disable()">Disable</a>
  19. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="enable()">Enable</a>
  20. </div>
  21. <input id="cc" class="easyui-combogrid" style="width:250px" data-options="
  22. panelWidth: 500,
  23. idField: 'itemid',
  24. textField: 'productname',
  25. url: 'datagrid_data1.json',
  26. method: 'get',
  27. columns: [[
  28. {field:'itemid',title:'Item ID',width:80},
  29. {field:'productname',title:'Product',width:120},
  30. {field:'listprice',title:'List Price',width:80,align:'right'},
  31. {field:'unitcost',title:'Unit Cost',width:80,align:'right'},
  32. {field:'attr1',title:'Attribute',width:200},
  33. {field:'status',title:'Status',width:60,align:'center'}
  34. ]],
  35. fitColumns: true
  36. ">
  37. <script type="text/javascript">
  38. function getValue(){
  39. var val = $('#cc').combogrid('getValue');
  40. alert(val);
  41. }
  42. function setValue(){
  43. $('#cc').combogrid('setValue', 'EST-13');
  44. }
  45. function disable(){
  46. $('#cc').combogrid('disable');
  47. }
  48. function enable(){
  49. $('#cc').combogrid('enable');
  50. }
  51. </script>
  52. </body>
  53. </html>