81f8e746ed574c07cbd56383a9780bd3af51fadc.svn-base 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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","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","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","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","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","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","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","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","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","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","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","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","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. columns: [
  42. { display: '姓名', name: 'name', align: 'center', width: 120,render: function (rowdata, rowindex, value, column){
  43. var mainCon=$('<div></div>');
  44. var con=$('<div class="nameContent"></div>');
  45. var nameObj=$('<div style="width:80px;float:left;"></div>');
  46. con.attr("userId",rowdata.id)
  47. nameObj.text(rowdata.name);
  48. con.append(nameObj);
  49. mainCon.append(con);
  50. return mainCon.html();
  51. }},
  52. { display: '性别', name: 'sex', align: 'center' , width: "30%"},
  53. { display: '部门', name: 'deptName', align: 'center' , width: "30%"},
  54. { display: '入职时间', name: 'beginworkDate', align: 'center', width: "40%" }
  55. ], data:testData, pageSize: 10, rownumbers:true, checkbox:true,percentWidthMode:true,
  56. height: '100%', width:"100%",onAfterShowData:onAfterShowData
  57. });
  58. }
  59. function onAfterShowData(data){
  60. $("#maingrid").find(".nameContent").each(function(){
  61. var lightCon=$('<div style="float:left;"><span class="cell_card"></span></div>');
  62. $(this).append(lightCon);
  63. $(this).append('<div class="clear"></div>');
  64. var cardObj=lightCon.find("span");
  65. var userid=$(this).attr("userId");
  66. var rowData;
  67. for (var record in data.rows){
  68. if(data.rows[record]['id']==Number(userid)){
  69. rowData=data.rows[record];
  70. }
  71. }
  72. var tableStr='<table>'+
  73. '<tr>'+
  74. '<td>性别:</td>'+
  75. '<td>'+rowData.sex+'</td>'+
  76. '</tr>'+
  77. '<tr>'+
  78. '<td>爱好:</td>'+
  79. '<td>'+rowData.hobby+'</td>'+
  80. '</tr>'+
  81. '<tr>'+
  82. '<td>学历:</td>'+
  83. '<td>'+rowData.degree+'</td>'+
  84. '</tr>'+
  85. '</table>'
  86. cardObj.tip({"arrowDirection":"left","auto":true,arrowDistanceY:12,content:tableStr});
  87. cardObj.hover(function(){
  88. $(this).addClass("cell_card_over");
  89. },function(){
  90. $(this).removeClass("cell_card_over");
  91. })
  92. })
  93. }
  94. </script>
  95. </body>
  96. </html>