basic.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Basic PropertyGrid - 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>Basic PropertyGrid</h2>
  14. <p>Click on row to change each property value.</p>
  15. <div style="margin:20px 0;">
  16. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="showGroup()">ShowGroup</a>
  17. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="hideGroup()">HideGroup</a>
  18. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="showHeader()">ShowHeader</a>
  19. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="hideHeader()">HideHeader</a>
  20. <a href="javascript:void(0)" class="easyui-linkbutton" onclick="getChanges()">GetChanges</a>
  21. </div>
  22. <table id="pg" class="easyui-propertygrid" style="width:300px" data-options="
  23. url:'propertygrid_data1.json',
  24. method:'get',
  25. showGroup:true,
  26. scrollbarSize:0
  27. ">
  28. </table>
  29. <script type="text/javascript">
  30. function showGroup(){
  31. $('#pg').propertygrid({
  32. showGroup:true
  33. });
  34. }
  35. function hideGroup(){
  36. $('#pg').propertygrid({
  37. showGroup:false
  38. });
  39. }
  40. function showHeader(){
  41. $('#pg').propertygrid({
  42. showHeader:true
  43. });
  44. }
  45. function hideHeader(){
  46. $('#pg').propertygrid({
  47. showHeader:false
  48. });
  49. }
  50. function getChanges(){
  51. var s = '';
  52. var rows = $('#pg').propertygrid('getChanges');
  53. for(var i=0; i<rows.length; i++){
  54. s += rows[i].name + ':' + rows[i].value + ',';
  55. }
  56. alert(s)
  57. }
  58. </script>
  59. </body>
  60. </html>