Js代码:
- $('#userTable').ligerGrid({
- '100%',
- height:'100%',
- title:'用户列表',
- //url:'',
- dataAction:'server',//问题就在于此,这里的dataAction设置为server此时并没有起到作用
- usePager:true,
- pageSize :10,
- pageSizeOptions :[10,20],
- columns:[{ display: '用户名', name: 'username', 100},
- { display: '所属部门', name: 'departmentName',isSort:true}],
- ],
- showTitle:true,
- showTableToggleBtn :true,
- allowAdjustColWidth:true,
- checkbox :false,
- cssClass :'',
- root :'rows',
- record:'total',
- delayLoad :false,
- enabledSort :false,
- allowUnSelectRow:true,
- allowUnSelectRow:true,
- mouseoverRowCssClass :'l-grid-row-over',
- rownumbers :true,
- frozen:false,
- //isScroll:false,
- frozenRownumbers :true,
- onToNext:function(){
- }
- });
所以在初始化datagrid完成后需要重新设置参数dataAction的值为server
Js代码:
- $('#userTable').ligerGrid().set('dataAction','server');