zoukankan      html  css  js  c++  java
  • 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. }

  • 相关阅读:
    vSphere 6.5支持512e,NVMe SSD呢?
    分布式队列神器 Celery
    www.coursera.org
    各种编码UNICODE、UTF-8、ANSI、ASCII、GB2312、GBK详解
    SSD S.M.A.R.T
    2018世界人工智能大会在上海开幕
    ER TO SQL语句
    E-R图样例
    关于微软的.NET版本系列
    ArcGIS 10.6 安装破解教程
  • 原文地址:https://www.cnblogs.com/signheart/p/6598162.html
Copyright © 2011-2022 走看看