]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - window/Edit.js
add apiCallDone callback for window.edit
[proxmox-widget-toolkit.git] / window / Edit.js
index 9548e213cda1f0f54d35fb9e79b6c4b4601724a5..aeb8019c7a4cb6d89daeb4dfe19061b47ad29975 100644 (file)
@@ -44,6 +44,10 @@ Ext.define('Proxmox.window.Edit', {
     // 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.
@@ -130,6 +134,8 @@ Ext.define('Proxmox.window.Edit', {
            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);
                }
@@ -139,6 +145,8 @@ Ext.define('Proxmox.window.Edit', {
                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