I don't want to use the dataSource's change event because I need to stay in scope where I manually call the sync() method.
5 Answers, 1 is accepted
Is there a way to add a callback function to the dataSource.sync() method? I want to sometimes execute a function after sync but not always.
I'm afraid that such callback is not available. As you have already noted the sync event should be used instead. You may know it is possible to use the one method to attach a event handler only once when it is required.
Other useful events in this case are change event (which in this case will have e.action argument set to sync), as well as requestEnd event which is raised before data is processed, providing access to the raw response.
Hello, I just wanted to update this post since the sync function now returns a promise. So, you can do something like this:
//callback logic in here