1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Poland
    Posts
    70
    Answers
    4
    Vote Rating
    5
    szimek is on a distinguished road

      0  

    Default Answered: How to properly update instance of a model in a store using data from server?

    Answered: How to properly update instance of a model in a store using data from server?


    I've got a model and a store. The main view submits all changes via store and its REST proxy using:

    Code:
    record.set({field: value})
    store.sync();
    However, I've got another view (form.Panel) and it does non-REST request using simply form.submit(). In this case server responds with JSON representation of the record (just like for REST requests). I'd like to update the instance of the record in the store with the received data and trigger all store events that would be called if it was received by the store (e.g. some views listen to "write" event to update its record). How to do it?

    Using record.set(data) marks it as dirty. Using record.setData(data) doesn't mark record as dirty, but then if I use view.setRecord(record), its updateRecord method is not called.

  2. Maybe:
    record.set(data);
    record.commit();

  3. #2
    Sencha User
    Join Date
    Nov 2012
    Location
    Netherlands
    Posts
    50
    Answers
    6
    Vote Rating
    1
    eastlander is on a distinguished road

      0  

    Default


    Maybe:
    record.set(data);
    record.commit();

  4. #3
    Sencha User
    Join Date
    Oct 2012
    Location
    Poland
    Posts
    70
    Answers
    4
    Vote Rating
    5
    szimek is on a distinguished road

      0  

    Default


    Thanks! Somehow I overlooked it when looking through API docs.

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