FritFrut
21 Jun 2007, 7:16 AM
Hello
I'm trying to use AutoGrid, as described in a few articles here. I'm also using slightly modified JsonReader and a proxy class similar to DWRProxy. My Store is set to remoteSort.
My first call to load data looks like this:
dataSource.load({params:{start:0, limit:pageSize}, meta: true});
I have configured JsonReader like this:
Ext.data.JsonReader({root: 'result.data',
totalProperty: 'result.total',
metaProperty: 'result.metaData',
id: 'id'})
where 'metaProperty' is the name of the property which holds the metadata.
My JSON RPC Proxy class is similar to DWRProxy. Here's the load method:
this.load = function(params, reader, callback, scope, arg)
{
var loadMeta = arg.meta || false ;
_jsonRpcProxy[listMethod] (params.start, params.limit, params.sort, params.dir, loadMeta,
this.loadResponse.createDelegate(this, [reader, callback, scope, arg], true )
).call(Tom.JsonRpcProxy.ext_channel1);
}
Everything works fine, but there's a little problem: sorting on columns doesn't work if I don't change a current page of data. I believe that the problem is in the sort method in Store. If remote sort is used, it just calls load with the lastOptions parameter, which again loads the metadata:
this.load(this.lastOptions);
(my metadata has default sortinfo value).
After I change page of data, meta property is removed from the lastOptions and everything works as expected.
So, my question is, am I doing something wrong, or is this a bug? What is the best way to change he lastOptions? This is marked as private, so I'd rather not poke too much if not necessary.
I'm trying to use AutoGrid, as described in a few articles here. I'm also using slightly modified JsonReader and a proxy class similar to DWRProxy. My Store is set to remoteSort.
My first call to load data looks like this:
dataSource.load({params:{start:0, limit:pageSize}, meta: true});
I have configured JsonReader like this:
Ext.data.JsonReader({root: 'result.data',
totalProperty: 'result.total',
metaProperty: 'result.metaData',
id: 'id'})
where 'metaProperty' is the name of the property which holds the metadata.
My JSON RPC Proxy class is similar to DWRProxy. Here's the load method:
this.load = function(params, reader, callback, scope, arg)
{
var loadMeta = arg.meta || false ;
_jsonRpcProxy[listMethod] (params.start, params.limit, params.sort, params.dir, loadMeta,
this.loadResponse.createDelegate(this, [reader, callback, scope, arg], true )
).call(Tom.JsonRpcProxy.ext_channel1);
}
Everything works fine, but there's a little problem: sorting on columns doesn't work if I don't change a current page of data. I believe that the problem is in the sort method in Store. If remote sort is used, it just calls load with the lastOptions parameter, which again loads the metadata:
this.load(this.lastOptions);
(my metadata has default sortinfo value).
After I change page of data, meta property is removed from the lastOptions and everything works as expected.
So, my question is, am I doing something wrong, or is this a bug? What is the best way to change he lastOptions? This is marked as private, so I'd rather not poke too much if not necessary.