PDA

View Full Version : Paging toolbar fo local data store



raiwinashu
12 Dec 2011, 7:33 AM
Hi,

I am new to Ext-Js and i am trying to implement grid paging based on local data store , Could any onecheck my code and tell me what's wrong in the code, and how to implement in right way



Ext.onReady(function () {
var store = Ext.create('Ext.data.Store', {
storeId: 'BStore',
pageSize: 5,
fields: ['Sno', 'Bname', 'bauthor', 'Price', 'Country', 'ISBN'],
data: { "total":26,"items": [
{ 'Sno': 'A001', "Bname": "Think and Grow Rich", "bauthor": "Napolean Hill", "Price": "100", "Country": "India", "ISBN": "10:81-88452-34-3" },{......},........{.......}
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items',
totalProperty:'total'
}
}
});

var grid = Ext.create('Ext.grid.Panel', {
title: 'Column Demo',
store: store,
bbar: Ext.create('Ext.PagingToolbar', {
pageSize:5,

displayinfo: true,
emptyMessage: 'No Data found',
store: store
}),
pageSize: 10,
columns: [
{ text: 'Serial No', dataIndex: 'Sno' },
{ text: 'Book Name', dataIndex: 'Bname' },
{ text: 'Book Author', dataIndex: 'bauthor' },
{ text: 'Price', dataIndex: 'Price' },
{ text: 'Available Country', dataIndex: 'Country' },
{ text: 'ISBN Code', dataIndex: 'ISBN' }
],
width:600,
renderTo: Ext.getBody()
});
store.load({ start: 0, limit: 10 });
});

Thanks in advance for your time and effort


Regards,
Ashwin

mitchellsimoens
12 Dec 2011, 11:39 AM
Local paging is not supported.

Please post in the appropriate forum. I have moved this to the Ext JS 4 Q&A forum for you. Also, wrap your code in code tags.