footer.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>TreeGrid with Footer - 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>TreeGrid with Footer</h2>
  14. <div class="demo-info">
  15. <div class="demo-tip icon-tip"></div>
  16. <div>Show summary information on TreeGrid footer.</div>
  17. </div>
  18. <div style="margin:10px 0;"></div>
  19. <table id="tg"></table>
  20. <script type="text/javascript">
  21. $(function(){
  22. $('#tg').treegrid({
  23. title:'TreeGrid with Footer',
  24. iconCls:'icon-ok',
  25. width:700,
  26. height:250,
  27. rownumbers: true,
  28. animate:true,
  29. collapsible:true,
  30. fitColumns:true,
  31. url:'treegrid_data2.json',
  32. method: 'get',
  33. idField:'id',
  34. treeField:'name',
  35. showFooter:true,
  36. columns:[[
  37. {title:'Task Name',field:'name',width:180},
  38. {field:'persons',title:'Persons',width:60,align:'right'},
  39. {field:'begin',title:'Begin Date',width:80},
  40. {field:'end',title:'End Date',width:80},
  41. {field:'progress',title:'Progress',width:120,
  42. formatter:function(value){
  43. if (value){
  44. var s = '<div style="width:100%;border:1px solid #ccc">' +
  45. '<div style="width:' + value + '%;background:#cc0000;color:#fff">' + value + '%' + '</div>'
  46. '</div>';
  47. return s;
  48. } else {
  49. return '';
  50. }
  51. }
  52. }
  53. ]]
  54. });
  55. })
  56. </script>
  57. </body>
  58. </html>