1. #1
    Sencha User
    Join Date
    Sep 2009
    Posts
    10
    Vote Rating
    0
    nagavasantha is on a distinguished road

      0  

    Question Is Ext.Data.JSONReader invoked when add method is called on Ext.Data.Store

    Is Ext.Data.JSONReader invoked when add method is called on Ext.Data.Store


    Hi,

    I have a question regarding the add method in Store.

    When we call a add method explicitly on a Store object, do the JSONReader configured with the store gets invoked ?

    For Example,

    If the store is declared as below:

    var ExampleStore = new vExt.data.Store({
    reader: new vExt.data.JsonReader({root:'rows',id:'id'}, vExt.data.Record.create([
    {name: 'id', mapping:'BaseId'},
    {name: 'name'},
    {name: 'state', mapping: 'country', convert: function(v) {
    return v.split(':')[0]; }},
    ]))
    });

    If add method is invoked on this store by adding a record and then try to display the values using the Ext.grid.ColumnModel, will the JSONReader gets invoked ?


    Please give me the reply as soon as possible.

    Thanks in advance,
    Vasantha.

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    If you're adding a record, no, the reader is not. It's not needed.

  3. #3
    Ext User
    Join Date
    Aug 2009
    Posts
    588
    Vote Rating
    1
    Mike Robinson is on a distinguished road

      0  

    Default


    I found out a lot more than I wanted to know about just how this code works as I was working (successfully...) to get it all to work with CF8 (ColdFusion 8). The logic really happens in Store, near the method "execute" and the methods which follow.
    1. Only read requests are actually sent through the Reader object. (readResponse.)
    2. All three of the other CRUD request-types are direct AJAX calls. add and update must return a list of records with (at least) the ID field-value, which are merged back into the store data (see realize). These use callback routines (e.g. doUpdateRecords) in Store.
    3. The Writer object, if you use one, is really only a data-translator, but its presence is significant.
    4. There are several objects involved (e.g. httpProxy) depending on your exact setup. All of them, in typical Ajaxian fashion, use callbacks. Fortunately, the code is well organized and easy to follow.
    I wrote an "Instant CRUD" posting not long ago in this forum, and am maintaining it as I work out the kinks of using ExtJS with ColdFusion-8 at our facility. Within the source code to that script ("InstantCRUD.CFC", in the zip) are a lot of comments.

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