basic.html 1.9 KB

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