atul.sachan@capgemini.com
22 Nov 2011, 3:41 AM
I am using ExtJs 4 'Ext.toolbar.Paging' for local data but pagination is not working here.
// Data
var gridData = [['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF'],
['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF'],
['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF'],
['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF'],
['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF']];
// Store
var gridDataStore = Ext.create('Ext.data.ArrayStore', {fields: [{name: 'cusPONum'},{name: 'orderDate'},{name: 'facilityCode'},{name: 'facility'},{name: 'gmOrderNo'},
{name: 'orderType'},{name: 'orderStatus'},{name: 'lstShipment'},{name: 'lstShipmentNum'},{name: 'pdfimg'},],
data: gridData,autoLoad: false, pageSize:1
});
// loading a store
gridDataStore.load({
params : {
start : 0,
limit : 1
}
});
/// paging toolbar
dockedItems: [{
xtype: 'pagingtoolbar',
store: gridDataStore, // same store GridPanel is using
dock: 'bottom',
//width:150,
displayInfo: false,
items :[{xtype:'button',text:'Export to Excel',width:100,style :{marginLeft:'500px'}},
{xtype:'button',text:'Print Preview',width:100,style :{marginLeft:'20px'}}]
}],
could you please suggest any solution for the same?
Thanks.
// Data
var gridData = [['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF'],
['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF'],
['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF'],
['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF'],
['7354','29/03/2011','003','Lution PDC','12345678','Standard','Shipped','30/03/2011','123232145','PDF']];
// Store
var gridDataStore = Ext.create('Ext.data.ArrayStore', {fields: [{name: 'cusPONum'},{name: 'orderDate'},{name: 'facilityCode'},{name: 'facility'},{name: 'gmOrderNo'},
{name: 'orderType'},{name: 'orderStatus'},{name: 'lstShipment'},{name: 'lstShipmentNum'},{name: 'pdfimg'},],
data: gridData,autoLoad: false, pageSize:1
});
// loading a store
gridDataStore.load({
params : {
start : 0,
limit : 1
}
});
/// paging toolbar
dockedItems: [{
xtype: 'pagingtoolbar',
store: gridDataStore, // same store GridPanel is using
dock: 'bottom',
//width:150,
displayInfo: false,
items :[{xtype:'button',text:'Export to Excel',width:100,style :{marginLeft:'500px'}},
{xtype:'button',text:'Print Preview',width:100,style :{marginLeft:'20px'}}]
}],
could you please suggest any solution for the same?
Thanks.