Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Aug 2014
    Posts
    8
    Vote Rating
    0
    ConnorT is on a distinguished road

      0  

    Default store.sync call back does not work on running it second time

    store.sync call back does not work on running it second time


    I have structure like store.sync({
    success: function (){},
    failure: function(){}
    });

    Problem is that if I don't hide or close my input form, and try to input twice. The first time, it will run the callback functions, however, the second time, it will not run the success or failure at all.

  2. #2
    Sencha - Senior Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,044
    Vote Rating
    992
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    So if you have something like this it will not execute:

    Code:
    store.sync({
        success : function() {
            someRecord.set('foo', 'bar');
    
            store.sync({
                success : function() {}
            });
        }
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Aug 2014
    Posts
    8
    Vote Rating
    0
    ConnorT is on a distinguished road

      0  

    Default


    I don't have any store.sync within the callback. In the callback functions, it is just simply outputing the status messages.
    Quote Originally Posted by mitchellsimoens View Post
    So if you have something like this it will not execute:

    Code:
    store.sync({
        success : function() {
            someRecord.set('foo', 'bar');
    
            store.sync({
                success : function() {}
            });
        }
    });

  4. #4
    Sencha User
    Join Date
    Aug 2014
    Posts
    8
    Vote Rating
    0
    ConnorT is on a distinguished road

      0  

    Default


    I noticed that there is a 'callback' function except the success and failure, so is it possible store.sync will call the 'callback'? Or is the 'callback' the default function when store finishes its work?

Thread Participants: 1