PDA

View Full Version : Reg. PagingToolbar



After2050
23 Nov 2010, 6:03 AM
Hi,

I'm facing a scenario where I have data intially. I'm loading the data in a store and using the store for both a Dataview & Pagingtoolbar. The problem is Pagingtoolbar is not working in this case. Please see the code below. Any help will be greatly appreciated.


//store
var store = new Ext.data.JsonStore({
root: '',
data: _layoutsData, //initial data
autoLoad: true,
autoDestroy: true,
fields: [
{ name: 'ID', type: 'int' },
{ name: 'LayoutName', type: 'string'}]
});

//paging toolbar
var _bbar = new Ext.PagingToolbar({
id: 'bbar',
store: store,
pageSize: 6,
displayInfo: true,
displayMsg: 'Color Schemes {0} - {1} of {2}',
emptyMsg: "No color schemes to display"
});

//dataview
var view = new Ext.DataView({
id: 'images-dataview',
store: store,
tpl: templates.chooseScheme,
style: { height: '380px' },
singleSelect: true,
overClass: 'x-view-over',
itemSelector: 'div.thumb-wrap',
emptyText: 'No color schemes to display'
});

var panel = new Ext.Panel({
renderTo: Ext.getBody(),
id: 'images-view',
width: 760,
height: 490,
cls: 'choose-template',
items: [_view, _bbar]
});

Condor
23 Nov 2010, 6:21 AM
An Ext.data.Store can only do remote paging.

If you want local paging then you should use the PagingStore user extension.

After2050
23 Nov 2010, 9:00 AM
Thanks for your reply Condor. Can you plz provide the link where I can get the PagingStore user extension.

Dnana

darthwes
23 Nov 2010, 9:30 AM
Here's the link (http://www.sencha.com/forum/showthread.php?71532-Ext.ux.data.PagingStore-v0.5). You could have found this in the docs for Ext.PagingToolbar (http://dev.sencha.com/deploy/dev/docs/?class=Ext.PagingToolbar).

After2050
23 Nov 2010, 10:05 PM
Got a bad eye. Just didn't notice that. Thanks for it.