1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    80
    Vote Rating
    0
    FritFrut is on a distinguished road

      0  

    Default help with loading metadata and sorting

    help with loading metadata and sorting


    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:
    Code:
    dataSource.load({params:{start:0, limit:pageSize}, meta: true});
    I have configured JsonReader like this:
    Code:
    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:
    Code:
    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:
    Code:
    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.

  2. #2
    Ext User
    Join Date
    Jun 2007
    Posts
    26
    Vote Rating
    0
    methodz is on a distinguished road

      0  

    Default Any luck

    Any luck


    Have you had any luck with this issue?

  3. #3
    Ext User
    Join Date
    Jun 2007
    Posts
    26
    Vote Rating
    0
    methodz is on a distinguished road

      0  

    Default Thank you!

    Thank you!


    I solved this problem by overriding the Store's sort method and dropping the meta property from lastOptions.

    [PHP]Ext.override(Ext.data.Store, {
    load : function(options){
    options = options || {};
    if(this.fireEvent("beforeload", this, options) !== false){
    this.storeOptions(options);
    var p = Ext.apply(options.params || {}, this.baseParams); //

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    223
    Vote Rating
    0
    tof is on a distinguished road

      0  

    Default


    I encountered the same problem.
    My workaround has been server side, I send metaDatas only when no "sort" field has been sent.
    This is to be filled as a bug

  5. #5
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    223
    Vote Rating
    0
    tof is on a distinguished road

      0  

    Arrow Not a bug ?

    Not a bug ?


    This is actually specified in the documentation of jsonReader that only the first resultSet should have metaDatas (but if they change, of course) :

    The first data packet from the server would configure the reader by containing a metaData property as well as the data:...
    So, I won't file any bug report

  6. #6
    Sencha User genius551v's Avatar
    Join Date
    Mar 2007
    Posts
    287
    Vote Rating
    0
    genius551v is on a distinguished road

      0  

    Default Great..

    Great..


    methodz, great solution, this wors fine for me, tnks a millon...

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar