ui: remote target ns selector: add clear trigger

like we have for the local NS selector

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-05-14 18:40:51 +02:00
parent ed289736cf
commit a3d61f3fba
1 changed files with 19 additions and 0 deletions

View File

@ -94,6 +94,25 @@ Ext.define('PBS.form.RemoteNamespaceSelector', {
emptyText: gettext('Root'),
notFoundIsValid: true,
triggers: {
clear: {
cls: 'pmx-clear-trigger',
weight: -1,
hidden: true,
handler: function() {
this.triggers.clear.setVisible(false);
this.setValue('');
},
},
},
listeners: {
change: function(field, value) {
let canClear = value !== '';
field.triggers.clear.setVisible(canClear);
},
},
matchFieldWidth: false,
listConfig: {
loadingText: gettext('Scanning...'),