PDA

View Full Version : Container + DataView + PagingToolbar Issue



amt779
10 Feb 2011, 4:04 AM
var store1 = new Ext.data.JsonStore({
fields: ['name','path','id'],
proxy: new Ext.data.HttpProxy({
method: 'POST', url: "/query.processor.php?table=pict&act=getc&limit=0,11"
}),
});

pict.container = Ext.extend(Ext.Container, {
cls: 'pict',
scope: this,
initComponent: function() {
this.items = [
{
xtype: 'toolbar',
items: [
{
xtype: 'button',
scope: this,
iconCls: 'reload-ico',
handler: function(button){
store1.load();
}
},
{
xtype: 'paging',
pageSize: 2,
store: store1,
displayInfo: true
}
]
},
{
xtype: 'dataview',
store: store1,
tpl: new Ext.XTemplate('<tpl for="."><div class="item"><div class="inner"><img src = "{path}">{name}<br><br><i>#{id}</i></div></div></tpl>'),
itemSelector:'div.item'
}
];
pict.container.superclass.initComponent.call(this);
this.on('render', function(this1) {
var mask = new Ext.LoadMask(this1.id, {store: Ext.getCmp('dataview'+this1.id).store});
});
}
});

I have the Container with PagingToolbar & Dataview mounted on it. I have the JsonStore that is common for both Container & PagingToolbar. Store is being loaded strictly after the PagingToolbar is rendered.

Store gets 11 items. I set that PagingToolbar.pageSize = 2. So it says that there're 11 pages. But it doesn't change pages. And it says "Displaying 1 - 11 of 11" . All 11 on same page.

Is it bug with PagingToolbar ? How to resolve my issues ?