1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    heinob is on a distinguished road

      0  

    Default Unanswered: EXTJS 4: What to return from server when UPDATE (store.sync) is called

    Unanswered: EXTJS 4: What to return from server when UPDATE (store.sync) is called


    Hi,

    I have overwritten the json.reader and writer to do some data manipulation before data ist stored or read from or to the server.

    Now I have a problem when calling my UPDATE service during store.sync(). When I obly return {success:true} from the server I cannot re-manipulate the data in the reader and the record in the store is changed to manipulated data.

    When I return the record from the server as posted: {success:true, data:[{....}]} the records are re-manipulated perfectly but they are also doubled in the store. This is not an issue of my (re)manipulation because this record doubling happens also without the manipulation. Especially the idProperty (id) is unchanged, though I have to records with the same id in my store.

    Now, how can I return a record in the UPDATE service without having doubled it afterwards in the store?

    Thanks for your help,
    H.

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,663
    Answers
    130
    Vote Rating
    110
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    first, make sure that you call record.commit() after your own changes to remove the dirty flag. i never had issues with duplicated records so far, and especially if the idProperty is set correctly it should not happen that the store gets more than one entry with the same id.

    so, check your overrides as well and provide some coding sniplets for additional help.
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    3
    Vote Rating
    0
    heinob is on a distinguished road

      0  

    Default SOLUTION!!!

    SOLUTION!!!


    I finally found the reason for the described misbehavior: Within my model I had overwritten the constructor like this:

    Code:
    constructor: function(config) {
        this.callParent([config]);
    },
    I do not really remember why I did this, but since I deleted the constructor, everything works fine. But due to the fact that I am relatively new to EXT and JS I do not understand why this happens. Can anyone explain it to me? Thanks in advance!

  4. #4
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,663
    Answers
    130
    Vote Rating
    110
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    remove the [ ] in the parent call and it should work. the constructor can get used for dynamically changing configs, often used for stores etc. every child class of component has an initComponent method which i would prefer to use.
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

Thread Participants: 1

Tags for this Thread

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