From: Thomas Lamprecht Date: Sat, 21 Nov 2020 18:42:57 +0000 (+0100) Subject: edit window: url is optional if both loadUrl and submitUrl are set X-Git-Url: https://git.proxmox.com/?p=proxmox-widget-toolkit.git;a=commitdiff_plain;h=8969bdadf6b397b6d255626178615d47aa039b21;hp=8b1217145c9645371420ff575aa79bef6b73035e edit window: url is optional if both loadUrl and submitUrl are set but it cannot be the default identityFn in that case.. Signed-off-by: Thomas Lamprecht --- diff --git a/src/window/Edit.js b/src/window/Edit.js index 184020d..e952362 100644 --- a/src/window/Edit.js +++ b/src/window/Edit.js @@ -246,8 +246,12 @@ Ext.define('Proxmox.window.Edit', { initComponent: function() { let me = this; - if (!me.url) { - throw "no url specified"; + if (!me.url && ( + !me.submitUrl || !me.loadUrl || me.submitUrl === Ext.identityFn || + me.loadUrl === Ext.identityFn + ) + ) { + throw "neither 'url' nor both, submitUrl and loadUrl specified"; } if (me.create) {throw "deprecated parameter, use isCreate";} @@ -257,7 +261,7 @@ Ext.define('Proxmox.window.Edit', { me.items = undefined; me.formPanel = Ext.create('Ext.form.Panel', { - url: me.url, + url: me.url, // FIXME: not in 'form' class, safe to remove?? method: me.method || 'PUT', trackResetOnLoad: true, bodyPadding: me.bodyPadding !== undefined ? me.bodyPadding : 10,