1. #1
    Touch Premium Member
    Join Date
    Jun 2012
    Posts
    22
    Vote Rating
    0
    ahcnse is on a distinguished road

      0  

    Default Override ArrayReader's readRecords() method to convert data from server

    Override ArrayReader's readRecords() method to convert data from server


    Hi
    ExtJS 3.4.0
    I need to convert data to a different format and I'm attempting to do this by overriding the readRecords() method.
    So far this code gives an error after the 'readRecords:' console message.
    Any help or suggestions or links to samples would be appreciated.

    Code:
    readRecords:
    TypeError: b is undefined
    Code:
        var MyFields = Ext.data.Record.create([
            {name: 'id'},
            {name: 'name'}
        ]);
    
        MyReader = Ext.extend(Ext.data.ArrayReader, {
            fields: MyFields,
    
            readRecords: function(o) {
                console.log('readRecords:');
                MyReader.superclass.readRecords.apply(this, o); 
            }
    
        });
    
         MyStore = Ext.extend(Ext.data.ArrayStore, {
            reader: new MyReader()
        });

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    63
    Vote Rating
    0
    jorgeluislay is an unknown quantity at this point

      0  

    Default


    So this field in the reader can convert the value you are parsing to the one you want. Here you can see that i get from server only a string "false" or "true" and with this function i change it for a boolean true or false. I hope it helps ?

    PHP Code:
     {
                       
    name'released',
                       
    mapping'realeased',
                       
    convert:  function(vr){
                        var 
    ret false;
                        if (
    == "true") {
                            
    ret true;
                        }
                        return 
    ret;
                    }
                       } 

  3. #3
    Touch Premium Member
    Join Date
    Jun 2012
    Posts
    22
    Vote Rating
    0
    ahcnse is on a distinguished road

      0  

    Default


    This thread describes what I need to do, but in Sencha Architect.

    HOWTO - reformat data sent from server at the Store
    http://www.sencha.com/forum/showthread.php?243849

    I need to do the same thing in ExtJS 3.4.0
    Any help/suggestions would be greatly appreciated.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi