Chris
Chris

Reputation: 1642

store.sync() callback

Is there a callback for store.sync()?

I am trying to do:

store.sync(function(){
   alert('1');
});

but it does not work. The store is a local store.

Upvotes: 0

Views: 3325

Answers (3)

Vitalii Blagodir
Vitalii Blagodir

Reputation: 1099

There is the way to listen success event

store.on('write', function(){
    alert('ready');
});
store.sync();

write fires whenever a successful write has been made via the configured Proxy

Upvotes: 0

Alex
Alex

Reputation: 1394

There is no 'callback' for sync(). In order to achieve this behaviour, you will need to listen to the store's write event. Check this solution.

Upvotes: 1

Eli
Eli

Reputation: 14827

You can try:

store.sync({
    callback: function (records, operation) {
        alert('1');
    }
});

Upvotes: 0

Related Questions