fb1c3839bb80da4fb7f0ef911ffe6aab8ed35ea2.svn-base 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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 class="padding_right5">
  20. <div id="maingrid"></div>
  21. </div>
  22. <script type="text/javascript">
  23. var testData={"form.paginate.pageNo":1,"form.paginate.totalRows":13,"rows":[
  24. {"deptName":"部门1","sex":"女","remark":"好啊","hobby":["唱歌"],"beginworkDate":"2012-06-13 00:00:00.0","photo":null,"version":null,"id":125,"degree":"硕士结业","age":20,"name":"员工1","deptId":12,"ability":1},
  25. {"deptName":"部门1","sex":"男","remark":"备注啊","hobby":["唱歌"],"beginworkDate":"2012-06-13 00:00:00.0","photo":null,"version":null,"id":124,"degree":"本科毕业","age":20,"name":"员工2","deptId":11,"ability":2},
  26. {"deptName":"部门1","sex":"男","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-12 00:00:00.0","photo":null,"version":null,"id":123,"degree":"本科毕业","age":20,"name":"员工3","deptId":9,"ability":2},
  27. {"deptName":"部门1","sex":"女","remark":"不错啊","hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-12 00:00:00.0","photo":null,"version":null,"id":121,"degree":"硕士肄业","age":20,"name":"员工4","deptId":8,"ability":3},
  28. {"deptName":"部门1","sex":"男","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-12 00:00:00.0","photo":null,"version":null,"id":120,"degree":"博士肄业","age":20,"name":"员工5","deptId":7,"ability":4},
  29. {"deptName":"部门2","sex":"女","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-05 00:00:00.0","photo":null,"version":null,"id":119,"degree":"博士肄业","age":20,"name":"员工6","deptId":6,"ability":5},
  30. {"deptName":"部门2","sex":"女","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-05 00:00:00.0","photo":null,"version":null,"id":118,"degree":"博士肄业","age":20,"name":"员工7","deptId":6,"ability":6},
  31. {"deptName":"部门2","sex":"女","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-05 00:00:00.0","photo":null,"version":null,"id":117,"degree":"博士肄业","age":20,"name":"员工8","deptId":6,"ability":5},
  32. {"deptName":"部门2","sex":"女","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-05 00:00:00.0","photo":null,"version":null,"id":116,"degree":"博士肄业","age":20,"name":"员工9","deptId":6,"ability":3},
  33. {"deptName":"部门2","sex":"女","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-05 00:00:00.0","photo":null,"version":null,"id":115,"degree":"博士肄业","age":20,"name":"员工10","deptId":6,"ability":1},
  34. {"deptName":"部门2","sex":"女","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-05 00:00:00.0","photo":null,"version":null,"id":114,"degree":"博士肄业","age":20,"name":"员工11","deptId":6,"ability":5},
  35. {"deptName":"部门2","sex":"女","remark":null,"hobby":["唱歌","跳舞"],"beginworkDate":"2012-06-05 00:00:00.0","photo":null,"version":null,"id":113,"degree":"博士肄业","age":20,"name":"员工12","deptId":6,"ability":5}
  36. ]}
  37. //数据表格使用
  38. var g;
  39. function initComplete(){
  40. g = $("#maingrid").quiGrid({
  41. /*
  42. columns: [
  43. { display: '姓名', name: 'name', align: 'center', width: "30%"},
  44. { display: '性别', name: 'sex', align: 'center' , width: "20%"},
  45. { display: '部门', name: 'deptName', align: 'center' , width: "30%"},
  46. { display: '学历', name: 'degree', align: 'center', width: "20%" }
  47. ], data:testData, pageSize: 10, rownumbers:true, checkbox:true,percentWidthMode:true,
  48. height: '100%', width:"100%"
  49. */
  50. columns : [
  51. {
  52. display : '姓名',
  53. name : 'name',
  54. align : 'left',
  55. width : "20%"
  56. },
  57. {
  58. display: '性别',
  59. name: 'sex',
  60. align: 'left',
  61. width: "20%"
  62. },
  63. {
  64. display: '身份证号',
  65. name: 'hobby',
  66. align: 'left',
  67. width: "20%"
  68. },
  69. {
  70. display: '出生地',
  71. name: 'degree',
  72. align: 'left',
  73. width: "20%"
  74. },
  75. {
  76. display: '更新日期',
  77. name: 'beginworkDate',
  78. align: 'left',
  79. width: "20%"
  80. },
  81. {
  82. display : '操作',
  83. isAllowHide : false,
  84. align : 'left',
  85. width : 80,
  86. resizable:false,
  87. render : function(rowdata, rowindex, value,
  88. column) {
  89. return '<div class="padding_top4 padding_left5">'
  90. + '<span class="img_view hand" title="详细" n="' + rowdata.XM + '" bh="' + rowdata.BH + '" onclick="onView(this)"></span>'
  91. //+ '<span class="img_edit hand" title="修改" onclick="onEdit('
  92. //+ rowdata.BH
  93. //+ ')"></span>'
  94. + '<span class="img_delete hand" title="注销" onclick="onDelete('
  95. + rowdata.BH
  96. + ','
  97. + rowindex
  98. + ')"></span>' + '</div>';
  99. }
  100. } ],
  101. data:testData,
  102. sortName : 'name',
  103. rownumbers : true,
  104. checkbox : true,
  105. height : '100%',
  106. width: "100%",
  107. usePager: true,
  108. page : 1,
  109. pageSize: 20,
  110. percentWidthMode: true,
  111. checkbox: true,
  112. groupColumnName: "sex",
  113. groupColumnDisplay: '性别',
  114. groupRender: function(groupValue, groupData, groupColumnDisplay){
  115. switch(groupValue)
  116. {
  117. case "女":
  118. return "<font color=red>女性【共" + groupData.length + "人】</font>";
  119. break;
  120. case "男":
  121. return "男性【共" + groupData.length + "人】";
  122. break;
  123. default:
  124. return "其他【共" + groupData.length + "人】";
  125. break;
  126. }
  127. },
  128. toolbar : {
  129. items : [ {
  130. text: '新增',
  131. iconClass : 'icon_add'
  132. }, {
  133. line : true
  134. }, {
  135. text : '批量删除',
  136. iconClass : 'icon_delete'
  137. }, {
  138. line : true
  139. }, {
  140. text : '导入',
  141. iconClass : 'icon_import'
  142. }, {
  143. line : true
  144. }, {
  145. text : '导出当前页',
  146. iconClass : 'icon_export'
  147. }, {
  148. line : true
  149. }, {
  150. text : '导出全部',
  151. iconClass : 'icon_export'
  152. } ]
  153. }
  154. });
  155. }
  156. </script>
  157. </body>
  158. </html>