From 8886099fa57c1e2d4ec4b996a0ce7b0f87c7708c Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 18 Apr 2020 19:26:18 +0200 Subject: [PATCH] StdRemoveButton: enable by default if no selection model As in that case we normally want it to be enabled from the start, as no selection model is there and so we cannot wait until one item is selected until we enable it. Signed-off-by: Thomas Lamprecht --- button/Button.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/button/Button.js b/button/Button.js index e2fe853..8d1af4c 100644 --- a/button/Button.js +++ b/button/Button.js @@ -155,5 +155,16 @@ Ext.define('Proxmox.button.StdRemoveButton', { Ext.Msg.alert(gettext('Error'), response.htmlStatus); } }); - } + }, + initComponent: function() { + let me = this; + + // enable by default if no seleModel is there and disabled not set + if (me.initialConfig.disabled === undefined + && (me.selModel === null || me.selModel === false)) { + me.disabled = false; + } + + me.callParent(); + }, }); -- 2.39.2