我一直在试图让我的应用程序运行速度更快设置页面大小。 我是从一个巨大的XML文件读取(几千行),我想使用ListPaging插件在同一时间只加载一个页面“。
这里是我的清单:
xtype : 'list',
plugins: {
xclass: 'Ext.plugin.ListPaging',
autoPaging: true,
loadMoreText : 'Loading more...',
noMoreRecordsText : 'loaded'
},
store : 'mainStore',
height : '100%',
layout : 'fit',
id: 'myList',
flex : 5,
itemTpl : "foo"
这里是我的商店:
config: {
model : 'myApp.model.foo',
storeId: 'mainStore',
autoLoad: true,
//currentPage: 1,
//buffered: true,
pageSize: 15,
proxy : {
type : "ajax",
url : 'resources/images/data/fooBar.xml',
startParam: 'offset',
reader : {
type : "xml",
rootProperty : 'foo',
record : 'bar'
}
}
}
然而,当我运行它,我得到的是“加载更多...”在整个列表(而不是15项下)的底部文本,然后它只是再次加载相同的XML数据,但是这一次只是它加到整个名单“的结束。
如何设置页面大小,这样我只得到15名左右的项目每“页”显示,然后当我滚动到列表的底部(这是15个条目),我得到下一个15个项目串接到最后15项目从一共有30个项目显示..等等。
使用Sencha触摸2.4.1
更新:这里是配置:
config: {
model : 'c17App.model.approaches',
storeId: 'mainStore',
autoLoad: true,
pageSize: 15,
proxy : {
type : "ajax",
url : 'resources/images/data/approach_all.xml',
total: 17,
start: 1,
limit: 15,
reader : {
type : "xml",
rootProperty : 'approaches',
record : 'approach',
totalProperty: 'total'//maybe needs to be a number?
}
}
}