1. 假分页,只加载一次数据,翻页操作不在执行后台查询
1. 首先初始化grid {
datatype:”local“,
}
2. 加载数据
$.post(url,data,function(data) {
gird.clearGridData();
gird.setGridParam({data: data.rows}); //数据格式就是json的rows的数据
gird.trigger(“reloadGrid”, [{page:1}]);
},’json’)
3. 如何获取所有数据,如果是编辑,获取编辑后的数据
gird.getGridParam(“data”)
2. 其他相关配置
1. 单元格编辑
2. 编辑相关的事件
shrinkToFit:false,
altRows: true, //显示行号
loadonce:true, //加载一次
loadAllData:true, //自定义的
autowidth: true, //宽度自适应
autoScroll:true, //自动显示滚动条
cellsubmit: ‘clientArray’, 编辑的时候,客户端事件
cellEdit:true,
afterEditCell:function(rowid, cellname, value, iRow, iCol) {
},
afterSaveCell:function(rowid, cellname, value, iRow, iCol) {
},