footer.html 1.6 KB

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