PDA

View Full Version : Paging Memory Proxy



amedina
21 Jun 2011, 11:30 AM
Can some one write an example how to use the Paging Memory Proxy. I want to create a paging on a grid.

This is my code

Ext.Loader.setConfig({ enabled: true });
Ext.Loader.setPath('Ext.ux', 'ux/');

Ext.require([
'Ext.data.*',
'Ext.tip.QuickTipManager',
'Ext.form.*',
'Ext.ux.data.PagingMemoryProxy',
'Ext.grid.Panel'
]);


Ext.define('Cases', {
extend: 'Ext.data.Model',
fields: ['nocase', 'client']
});


var store_cases = Ext.create('Ext.data.Store', {
model: 'Cases',
pageSize: 25,
remoteSort: true,
sorters: ['nocase', 'client'],
proxy: {
type:'pagingmemory',
url: 'getrecords.jsp',
reader: {
type: 'json'
, root: 'rows'
}
}
});

var grid_2 = Ext.create('Ext.grid.Panel', {
frame: false,
collapsible: false,
store: store_casos,
columns: [
{ text: "Num Case", flex: 1, dataIndex: 'nocase' }
, { text: "Client", flex: 1, dataIndex: 'client' }


]

,

bbar: Ext.create('Ext.PagingToolbar', {
store: store_cases,
pageSize: 25,
displayInfo: true,
displayMsg: 'Total {2}',
emptyMsg: "Nothing here"

}),

alphadogg
29 Jun 2011, 8:03 AM
I believe the Paging Memory Proxy allows one to use paging in a grid with in memory dataset, not with remote data.

xuefli
31 Mar 2012, 1:14 AM
the reason use Ext.ux.data.PagingMemoryProxy is that,when I import data from upload file component, I want to see every data's processed result in grid,and the processed result return by remote service, it store in memory proxy.
when there are a lot of data,I need page the data.

How I can use Ext.ux.data.PagingMemoryProxy in sencha Designer2.0

dmulcahey
1 Apr 2012, 4:57 AM
Maybe the alternative i just posted will help. Take a look at this (http://www.sencha.com/forum/showthread.php?192410-LocalPagingProxy-an-alternative-to-PagingMemoryProxy) and let me know if this helps you.

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