// the task finished. function(success)
taskDone: Ext.emptyFn,
+ // gets called when the api call is finished, right at the beginning
+ // function(success, response, options)
+ apiCallDone: Ext.emptyFn,
+
// assign a reference from docs, to add a help button docked to the
// bottom of the window. If undefined we magically fall back to the
// onlineHelp of our first item, if set.
method: me.method || (me.backgroundDelay ? 'POST' : 'PUT'),
params: values,
failure: function(response, options) {
+ me.apiCallDone(false, response, options);
+
if (response.result && response.result.errors) {
form.markInvalid(response.result.errors);
}
var hasProgressBar = (me.backgroundDelay || me.showProgress || me.showTaskViewer) &&
response.result.data ? true : false;
+ me.apiCallDone(true, response, options);
+
if (hasProgressBar) {
// stay around so we can trigger our close events
// when background action is completed