PDA

View Full Version : Paging Toolbar with server data



tina@user
9 Sep 2015, 1:38 AM
hi,
I have a grid with a paging toolbar with around 100 server data.
As per my requirement I need to show only 4 data at a time.

Is it possible for me to load the entire server data into store (during render itself ) and not send call to the server each time a next set of data is loaded using paging toolbar.

I have read about PagingMemoryProxy but coudnt figure out how to use it for server data.

Plase help!
Thanx!

jdkhamba
9 Sep 2015, 4:19 AM
You probably wanna use the local paging proxy user extension. Take a look at this thread :


https://www.sencha.com/forum/showthread.php?192410-LocalPagingProxy-an-alternative-to-PagingMemoryProxy

This talks about exactly what you are asking for.

tina@user
9 Sep 2015, 11:02 PM
But the data is not getting called...the server is not ven called for data..
here is my store




Ext.define('App.store.MachinesStore', {
extend : 'Ext.data.Store',

requires: [
'App.model.MachinesModel',
'Ext.ux.data.LocalPagingProxy'
],




constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'MachinesStore',
model: 'App.model.MachinesModel',
pageSize:5,
proxy: new Ext.ux.data.LocalPagingProxy({
serverProxy: new Ext.data.proxy.Ajax({
model: 'App.model.MachinesModel',
url: '/rest/getUserInstanceDetails/10604124',
reader:{
type:'json',
successProperty:'success',
root:'response'
}
})
}),
remoteSort: true,
remoteFilter: true
}, cfg)]);
}
});

jdkhamba
10 Sep 2015, 3:07 AM
You need the store.load() call or configure autoLoad:true in your store to make the server request.

tina@user
10 Sep 2015, 3:24 AM
i added autoLoad:true,

but this gives me the following error:-
Uncaught TypeError: Cannot read property 'prototype' of undefined

Thanx in advance!