Ext grid分页

minsheng0825 2011-05-27 05:13:42
我想实现grid分页,数据是写死的,分页的设置如下,并且store进行加载的时候也进行如下设置了
store.load({params:{start:0, limit:10}});
但是出现的问题是:底部的分页显示是正常的,共两页,但是显示的数据却是把全部的数据都进行了显示

var grid = new Ext.grid.EditorGridPanel( {
enableColumnMove : true, // 拖放
enableColumnResize : true, // 改变列高
stripeRows : true, // 斑马线
loadMask : true, // 加载数据时的提示信息
store : store,
cm : cm,
sm : sm,
autoWidth : true,
autoHeight : true,
autoExpandColumn : 'name',
viewConfig : {
forceFit : true
},
tbar : [ '->', {
xtype : 'button',
iconCls : 'deleteIcon',
text : '删除',
disabled : true,
ref : '../removeButton',
handler : function() {
Ext.Msg.confirm('信息', '确定要删除?', function(btn) {
});
}
}, '->', {
xtype : 'button',
iconCls : 'edit1Icon',
text : '查看',
// disabled : true,
// ref : '../queryButton',
handler : function() {
location.href = '../WebRoot/proInfo.html'
// queryItem.editWin();
}
} ],
bbar : new Ext.PagingToolbar( {
pageSize : 10,
store : store,
beforePageText : "当前第",
afterPageText : "页,共{0}页",
lastText : "尾页",
nextText : "下一页",
prevText : "上一页",
firstText : "首页",
refreshText : "刷新页面",
displayInfo : true,
displayMsg : "当前显示 {0} - {1} 行, 共 {2} 行",
emptyMsg : "还没有数据"
})
})

效果:
请高手帮帮忙
...全文
68 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
丶蒙圈丶 2011-05-27
  • 打赏
  • 举报
回复
换句话说,你需要根据 start limt pagesize 来处理的store
丶蒙圈丶 2011-05-27
  • 打赏
  • 举报
回复
光在页面设置没用的 ,你点击分页的时候它也是去后台刷新数据的,你的结果集是不是就返回的所有数据集合,你要返回你指定的分页数据哟,你指定的10条,那么后台一次只需要返回10条, 后台分页可以Page对象实现,或者根据前台提交的satat limt pagesize 来截取后台的数据集合

87,902

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧