我的ext js出了点问题。我正在尝试在网格面板上建立分页,并从REST获取数据。数据正在显示,但分页不起作用。
下面是我的代码:
pageSize: 5,
proxy: {
type: 'ajax',
url : 'http://localhost/kds-rest/web/index.php/volunteer',
useDefaultXhrHeader : false,
withCredentials: false,
reader: {
type: 'json'
//type: 'json',
//rootProperty: 'topics',
//totalProperty: 'totalCount'
//totalProperty: 'totalCount'
},
enablePaging : true
},
autoLoad: true发布于 2015-11-18 08:57:11
如果没有看到网格的代码,我只能猜测您没有在分页工具栏上声明存储。
发布于 2015-11-22 02:22:10
您已经将代理定义为Ext.data.proxy.Ajax,这是一种Ext.data.proxy.Server。
enablePaging属性仅在Ext.data.proxy.Memory上可用,它不支持对URL的XMLHttpRequest调用。
如果您希望使用服务器代理进行分页,则分页必须在服务器端完成:服务器不应一次返回所有记录,而是一次返回一页;在pageParam中,每次请求时都会自动从客户端传输页码。
https://stackoverflow.com/questions/33763475
复制相似问题