PDA

View Full Version : Client Side Paging!



nckenn
25 Jun 2014, 10:39 PM
how can i implement client side pagination in grid panel. can anyone give me a complete example or just help me to fix my code.

this is my model :

if (! Ext.ClassManager.isCreated('obligationModel')) { Ext.define('obligationModel', {
extend: 'Ext.data.Model',
idProperty : 'obr_code',
fields: [
.......................
]
});
}

store:

me.storeObligation = Ext.create('Ext.data.Store',{ id : 'Obligation',
model : 'obligationModel',
autoLoad: false,
pageSize: 100,
proxy : {
type: 'ajax',
url: 'Obligation.php',
method:'GET',
extraParams: {
Module: 'dOBR',
option: 'Obligation',
action: 'List'
},
reader: {
type : 'json',
root : 'data',
successProperty : 'success'
}

},
groupField: 'payee_name'
});

then i put this in my panel":

bbar: Ext.create('Ext.PagingToolbar', { store: me.storePersonal,
displayInfo: true,
displayMsg: 'Displaying record(s) {0} - {1} of {2}',
emptyMsg: "No record(s) to display"
})

Grolubao
30 Jun 2014, 1:26 AM
This will do exactly what you need:

http://www.sencha.com/forum/showthread.php?71532-Ext.ux.data.PagingStore-v0.5