I'm trying to implement the ListPaging plugin in RC 2. It pages once, but only once. It looks to me like the plug-in method loadNextPage is setting a _loading flag to true in the beginning of the method but not setting it to false before it exits. If I add this.setLoading(false) to the last line of that method the ListPaging plugin will work as I expected, paging multiple times. I'm overwriting the nextPage method on the store because I need to load the records in manually and I'm wondering if that is what is causing the problem, but I can't find anywhere in the store source where it would be setting the _loading flag to false either. Here is my app.js code to reproduce. You will see it will page once for a total of four records, but then stop unless you make the change to the loadNextPage method. Thanks.
Code:
Ext.application({
name: 'Scratch',
viewport: {
autoMaximize: true
},
launch: function(){
window.itemIndex = 0;
Ext.define('Scratch.store.Main', {
extend: 'Ext.data.Store',
config: {
fields: ['name'],
data: [
{ name: 'item ' + (window.itemIndex += 1) },
{ name: 'item ' + (window.itemIndex += 1) }
]
},
nextPage: function(){
this.add( { name: 'item ' + (window.itemIndex += 1) } );
this.add( { name: 'item ' + (window.itemIndex += 1) } );
}
});
var view = Ext.create('Ext.List', {
fullscreen: true,
store: new Scratch.store.Main(),
itemTpl: [
'<div>{name}</div>',
],
plugins: [
{
xclass: 'Ext.plugin.ListPaging',
autoPaging: true
}
]
});
Ext.Viewport.add(view);
Ext.Viewport.setActiveItem(view);
}
});