mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-22 15:15:53 +00:00
combogrid: add 'showClearTrigger' config
This allows one configure the clear trigger to be shown, even if 'allowBlank' is set false. This can be useful if one has a non-editable combogrid where the value is set to something not present in the store. Example: Match rule editing, one selects a backup job to be match. If the backup job is removed and the match rule edit window is opened again, then the old, deleted value cannot be removed from the combogrid if there is no clear trigger. Signed-off-by: Lukas Wagner <l.wagner@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
43b978658e
commit
4bee6fb074
@ -32,6 +32,7 @@ Ext.define('Proxmox.form.ComboGrid', {
|
|||||||
notFoundIsValid: false,
|
notFoundIsValid: false,
|
||||||
deleteEmpty: false,
|
deleteEmpty: false,
|
||||||
errorHeight: 100,
|
errorHeight: 100,
|
||||||
|
showClearTrigger: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
// needed to trigger onKeyUp etc.
|
// needed to trigger onKeyUp etc.
|
||||||
@ -54,7 +55,10 @@ Ext.define('Proxmox.form.ComboGrid', {
|
|||||||
setValue: function(value) {
|
setValue: function(value) {
|
||||||
let me = this;
|
let me = this;
|
||||||
let empty = Ext.isArray(value) ? !value.length : !value;
|
let empty = Ext.isArray(value) ? !value.length : !value;
|
||||||
me.triggers.clear.setVisible(!empty && me.allowBlank);
|
me.triggers.clear.setVisible(
|
||||||
|
(!empty && me.allowBlank) ||
|
||||||
|
(!empty && me.showClearTrigger),
|
||||||
|
);
|
||||||
return me.callParent([value]);
|
return me.callParent([value]);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user