1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    365
    Vote Rating
    0
    wuschba is on a distinguished road

      0  

    Default ArrayReader: Doesn't it support a total property?

    ArrayReader: Doesn't it support a total property?


    I have a store for a grid with an array-reader:
    Code:
     reader: new Ext.data.ArrayReader(
    			  {		root: 'data',
    				  	totalProperty: 'total'
    			  },
    			  record),
    And the server is sending this code:
    ({"total":"35","data":[["1","Name","Forename"],["2","Name2","Forename2"]]})

    But no records are read into to store/grid. I traced it down to readRecords of ArrayReader:

    Code:
    readRecords : function(o) {
    						var sid = this.meta ? this.meta.id : null;
    						var recordType = this.recordType, fields = recordType.prototype.fields;
    						var records = [];
    						var root = o;
    						for ( var i = 0; i < root.length; i++) {
    o is a object with o.total = 35 and o.data is the array of data.

    So in root the data is expected, but the data is not in o, it's in o.data (which I said it would be there in the constructor of the ArrayReader).

    It seems to me that there is no place in the code where the total-property or the root-property are taken care of. Doesn't ArrayReader work with a totalProperty and a root as said in the docs?

  2. #2
    Sencha User
    Join Date
    Nov 2007
    Location
    London, UK
    Posts
    583
    Vote Rating
    0
    mabello is on a distinguished road

      0  

    Default


    It returns the actual number of the records you have loaded in your reader.
    You can use http://extjs.com/forum/showthread.php?t=32908 maybe...
    Hope this helps

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Posts
    365
    Vote Rating
    0
    wuschba is on a distinguished road

      0  

    Default


    Thanks for your reply, I will try this. I'm wondering why it's not working (or only with additional code), because its definetly descriped in the docs

Thread Participants: 1

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