Code: Select all
complete: function(xhr, status) {
// this is your callback
if(cfg.oncomplete) {
cfg.oncomplete.call(this, xhr, status, xhr.pfArgs);
}
// this is the extension callback (datatable)
if(cfg.ext && cfg.ext.oncomplete) {
cfg.ext.oncomplete.call(this, xhr, status, xhr.pfArgs);
}
Why is the user oncomplete callback called before ext.oncomplete? I feel like I'm missing something here but since the DOM update and any other component updates usually happen in ext.oncomplete, this prevents users working with the updated components. For example, if you're using a page event in a datatable, oncomplete is called before the paginator.currentPage is actually updated.
I think this is counter intuitive since most users will expect oncomplete to be called after the DOM is updated.
The documentation is also a bit generic with regards to this:
Code: Select all
complete: (called) When everything finishes.