easy ui datagrid



 
   
  1. $(function(){
  2. $('#dataGrid').datagrid({
  3. nowrap: true,
  4. autoRowHeight: false,
  5. height:400,
  6. striped: true,
  7. collapsible:true,
  8. loadMsg:"数据加载中...",
  9. url:'${baseURL}/stuinfomge/stuinfomgeAction!ajaxSearch.action',
  10. loadFilter:function(data){
  11. try {
  12. tempData = data.data.resultMap;
  13. } catch (e) {
  14. tempData=data;
  15. }
  16. return tempData;
  17. },
  18. remoteSort:false,
  19. frozenColumns:[[
  20. {field:'ID',checkbox:true}
  21. ]],
  22. columns:[[
  23. {field:'STU_NAME',title:'学生姓名',width:120,sortable:true},
  24. {field:'ORGANIZATION_NAME',title:'所属班级',width:120,sortable:true},
  25. {field:'PARENT_NAME',title:'家长姓名',width:120,sortable:true},
  26. {field:'CONCAT_PHONE',title:'联系电话',width:120,sortable:true},
  27. {field:'CARD_NUM',title:'门禁卡号',width:120,sortable:true},
  28. {field:'CONCAT_ADDRESS',title:'联系地址',width:240,sortable:true},
  29. {field:'opt',title:'操作',width:200,align:'center',
  30. formatter:function(value,rec){
  31. var rethtml='';
  32. rethtml += "<span style=\"color:#08f;cursor:pointer;\" onclick=\"view('"+ rec.ID + "')\">查看</span>|";
  33. rethtml += "<span style=\"color:#08f;cursor:pointer;\" onclick=\"editStuinfo('"+ rec.ID + "')\">修改</span>|";
  34. rethtml += "<span style=\"color:#08f;cursor:pointer;\" onclick=\"rme('"+ rec.ID + "')\">删除</span>|";
  35. return rethtml;
  36. }
  37. }
  38. ]],
  39. pagination:true,
  40. rownumbers:true,
  41. toolbar:[{
  42. id:'btnadd',
  43. text:'新增',
  44. iconCls:'icon-add',
  45. handler:function(){
  46. shoPanelWindow('addStuinfoDiv',900,550,'icon-add','新增学生信息');
  47. }
  48. },'-',{
  49. id:'btnclear',
  50. text:'删除',
  51. iconCls:'icon-clear',
  52. handler:function(){
  53. var rows = getSelections();
  54. rme(rows)
  55. }
  56. },'-',{
  57. id:'btnimport',
  58. text:'批量导入',
  59. iconCls:'icon-import',
  60. handler:function(){
  61. }
  62. }]
  63. });
  64. var p = $('#dataGrid').datagrid('getPager');
  65. $(p).pagination({displayMsg:"",beforePageText:"当前页",afterPageText:"总页数:{pages}",
  66. onBeforeRefresh:function(){
  67. $('#dataGrid').datagrid("reload");
  68. }
  69. });
  70. });
  71. function getSelections(){
  72. var ids = [];
  73. var rows = $('#dataGrid').datagrid('getSelections');
  74. for(var i=0;i<rows.length;i++){
  75. ids.push("'" + rows[i].ID + "'");
  76. }
  77. return ids.join(',');
  78. }
  79. function doSearch(){
  80. $('#dataGrid').datagrid('loadData', { total: 0, rows: [] });
  81. $('#dataGrid').datagrid('load',{
  82. 'searchValue.stuname': ($("#stuname").val()),
  83. 'searchValue.orgid': ($("#searchorgid").val())
  84. });
  85. }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值