I've been trying to set a page size so that my app runs faster. I'm reading from a huge xml file (thousands of rows) and I want to use the ListPaging plugin to load only one 'page' at a time.
Here is my list:
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"
Here is my store:
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'
}
}
}
However when I run this, all I get is 'loading more...' text at the bottom of the entire list (not 15 items down), and then it only loads the same xml data again, but this time just concatenates it to the end of the entire 'list'.
How do I set the page size so that I only get 15 or so items to display per 'page', then when I scroll to the bottom of the list (that's 15 items long) I get the next 15 items concatenated to the last 15 items to make a total of 30 items display.. and so forth.
Using Sencha Touch 2.4.1
UPDATE: Here is the config:
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?
}
}
}