1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    27
    Vote Rating
    0
    ngardner is on a distinguished road

      0  

    Default Response from store / model after sync?

    Response from store / model after sync?


    How do I go about getting the response from my model after doing a sync? The proxy is set to an ajax request with a URL, and I need to verify the sync worked. How do I get the response to verify it was successful? I can the response in Firebug / Javascript Console - but I need to do some error handling. Thanks

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,360
    Vote Rating
    81
    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


    try listening for teh datachanged event.

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    59
    Vote Rating
    0
    1099511627776 is on a distinguished road

      0  

    Default


    I have the same question.
    I need to known whether the store was synced not the datachanged!!

  4. #4
    Sencha Premium Member
    Join Date
    May 2013
    Posts
    1
    Vote Rating
    0
    clifordshelton is on a distinguished road

      0  

    Default


    I do a manual store.sync() call to trigger the sync from my controller. When making the call I pass in parameters to callback after sync is done. Hope this helps.

    store.sync({
    success: function (){
    //Sync was successful
    },
    failure: function (){
    //Sync failed
    },
    callback: function (){
    //Always called after sync is complete whether it succeeded or not
    }
    });

Similar Threads

  1. Getting a Store to auto-sync?
    By schvenk in forum Sencha Touch 1.x: Discussion
    Replies: 10
    Last Post: 1 Aug 2011, 10:42 PM
  2. Using sync() response to control code flow
    By hoitomt in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 22 Feb 2011, 8:57 AM
  3. Replies: 4
    Last Post: 25 Sep 2010, 11:29 AM
  4. How To sync store / proxy / Model with "submodel" and localstorage
    By hq242 in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 30 Jul 2010, 5:58 AM

Thread Participants: 3