mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-19 13:32:27 +00:00
edit window: add optional custom submit options
sometimes it's necessary or handy to add custom options to the submit api call (e.g. timeout). So just expose a `submitOptions` where users of the edit window can put their custom options. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
8d161ac19c
commit
03e44f5b60
@ -31,6 +31,9 @@ Ext.define('Proxmox.window.Edit', {
|
|||||||
// custom submitText
|
// custom submitText
|
||||||
submitText: undefined,
|
submitText: undefined,
|
||||||
|
|
||||||
|
// custom options for the submit api call
|
||||||
|
submitOptions: {},
|
||||||
|
|
||||||
backgroundDelay: 0,
|
backgroundDelay: 0,
|
||||||
|
|
||||||
// string or function, called as (url, values) - useful if the ID of the
|
// string or function, called as (url, values) - useful if the ID of the
|
||||||
@ -151,7 +154,7 @@ Ext.define('Proxmox.window.Edit', {
|
|||||||
values = undefined;
|
values = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
Proxmox.Utils.API2Request({
|
let requestOptions = Ext.apply({
|
||||||
url: url,
|
url: url,
|
||||||
waitMsgTarget: me,
|
waitMsgTarget: me,
|
||||||
method: me.method || (me.backgroundDelay ? 'POST' : 'PUT'),
|
method: me.method || (me.backgroundDelay ? 'POST' : 'PUT'),
|
||||||
@ -191,7 +194,8 @@ Ext.define('Proxmox.window.Edit', {
|
|||||||
me.close();
|
me.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
}, me.submitOptions ?? {});
|
||||||
|
Proxmox.Utils.API2Request(requestOptions);
|
||||||
},
|
},
|
||||||
|
|
||||||
load: function(options) {
|
load: function(options) {
|
||||||
|
Loading…
Reference in New Issue
Block a user