解决ligerUI服务器分页Total不起作用的问题

Js代码:  
  1.     $('#userTable').ligerGrid({  
  2.         '100%',  
  3.         height:'100%',  
  4.         title:'用户列表',  
  5.         //url:'',  
  6.         dataAction:'server',//问题就在于此,这里的dataAction设置为server此时并没有起到作用  
  7.         usePager:true,  
  8.         pageSize :10,  
  9.         pageSizeOptions :[10,20],  
  10.           
  11.    columns:[{ display: '用户名', name: 'username',  100},  
  12.               
  13.             { display: '所属部门', name: 'departmentName',isSort:true}],  
  14.              
  15.                         ],  
  16.    showTitle:true,  
  17.    showTableToggleBtn :true,  
  18.    allowAdjustColWidth:true,  
  19.    checkbox :false,  
  20.    cssClass :'',  
  21.    root :'rows',  
  22.    record:'total',  
  23.    delayLoad :false,  
  24.    enabledSort :false,  
  25.    allowUnSelectRow:true,  
  26.    allowUnSelectRow:true,  
  27.    mouseoverRowCssClass :'l-grid-row-over',  
  28.    rownumbers :true,  
  29.    frozen:false,  
  30.    //isScroll:false,  
  31.    frozenRownumbers :true,  
  32.    onToNext:function(){  
  33.                       
  34.    }  
  35. });  

所以在初始化datagrid完成后需要重新设置参数dataAction的值为server 
Js代码:  
  1. $('#userTable').ligerGrid().set('dataAction','server');  
获取服务端数据后直接加载数据即可
原文地址:https://www.cnblogs.com/lauplay/p/3147896.html