c7e1dfca6e493d54bb5050cb2f1322bc6630c375.svn-base 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>数据汇总</title>
  6. <!--框架必需start-->
  7. <script type="text/javascript" src="../../libs/js/jquery.js"></script>
  8. <script type="text/javascript" src="../../libs/js/language/cn.js"></script>
  9. <script type="text/javascript" src="../../libs/js/framework.js"></script>
  10. <link href="../../libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  11. <link rel="stylesheet" type="text/css" id="skin" prePath="../../"/>
  12. <link rel="stylesheet" type="text/css" id="customSkin"/>
  13. <!--框架必需end-->
  14. <!--数据表格start-->
  15. <script src="../../libs/js/table/quiGrid.js" type="text/javascript"></script>
  16. <!--数据表格end-->
  17. </head>
  18. <body>
  19. <div id="maingrid" style="margin: 0; padding: 0"></div>
  20. <script type="text/javascript">
  21. var testData={"rows":[
  22. {"math":10,"name":"小1","english":10,"chinese":10,"sex":"男"},
  23. {"math":10,"name":"小2","english":10,"chinese":20,"sex":"女"},
  24. {"math":30,"name":"小3","english":30,"chinese":30,"sex":"男"},
  25. {"math":40,"name":"小4","english":40,"chinese":40,"sex":"女"},
  26. {"math":50,"name":"小5","english":50,"chinese":50,"sex":"男"},
  27. {"math":60,"name":"小6","english":60,"chinese":60,"sex":"男"},
  28. {"math":70,"name":"小7","english":70,"chinese":70,"sex":"女"}]};
  29. //数据表格使用
  30. var g;
  31. function initComplete(){
  32. g = $("#maingrid").quiGrid({
  33. columns: [
  34. { display: '姓名', name: 'name', align: 'center', width: 150},
  35. { display: '性别', name: 'sex', align: 'center', width: 100},
  36. { display: '语文', name: 'chinese', align: 'center', width: 150, totalSummary: {render:function(obj){return '总数:'+obj.sum}}},
  37. { display: '数学', name: 'math', align: 'center' , width: 150, totalSummary: {render:function(obj){return '最大值:'+obj.max}}},
  38. { display: '英语', name: 'english', align: 'center' , width: 200, totalSummary: {render:function(obj){return '平均值:'+obj.avg}}}
  39. ],
  40. data:testData, usePager: false, sortName: 'id',rownumbers:true,height: '100%', width:"100%",groupColumnName: "sex", groupColumnDisplay: "性别"
  41. });
  42. }
  43. </script>
  44. </body>