mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-08-12 09:13:04 +00:00
edit window: add submitUrl config
Helps for those cases where the id is in the API path itself. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
9beeadc77a
commit
4d07ee6cb9
@ -30,6 +30,10 @@ Ext.define('Proxmox.window.Edit', {
|
|||||||
|
|
||||||
backgroundDelay: 0,
|
backgroundDelay: 0,
|
||||||
|
|
||||||
|
// string or function, called as (url, values) - useful if the ID of the
|
||||||
|
// new object is part of the URL, or that URL differs from GET/PUT URL
|
||||||
|
submitUrl: Ext.identityFn,
|
||||||
|
|
||||||
// needed for finding the reference to submitbutton
|
// needed for finding the reference to submitbutton
|
||||||
// because we do not have a controller
|
// because we do not have a controller
|
||||||
referenceHolder: true,
|
referenceHolder: true,
|
||||||
@ -132,7 +136,9 @@ Ext.define('Proxmox.window.Edit', {
|
|||||||
values.background_delay = me.backgroundDelay;
|
values.background_delay = me.backgroundDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = me.url;
|
let url = Ext.isFunction(me.submitUrl)
|
||||||
|
? me.submitUrl(me.url, values)
|
||||||
|
: me.submitUrl || me.url;
|
||||||
if (me.method === 'DELETE') {
|
if (me.method === 'DELETE') {
|
||||||
url = url + "?" + Ext.Object.toQueryString(values);
|
url = url + "?" + Ext.Object.toQueryString(values);
|
||||||
values = undefined;
|
values = undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user