ui: storage content view: add clear trigger to search

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-11-16 09:58:22 +01:00
parent 1d8306e4ca
commit c8a71b9e1f

View File

@ -288,21 +288,41 @@ Ext.define('PVE.storage.ContentView', {
xtype: 'textfield',
width: 200,
enableKeyEvents: true,
emptyText: gettext('Name, Format'),
listeners: {
keyup: {
buffer: 500,
keyup: function(field) {
fn: function(field) {
store.clearFilter(true);
store.filter([
{
property: 'text',
value: field.getValue(),
anyMatch: true,
caseSensitive: false
}
caseSensitive: false,
},
]);
},
},
change: function(field, newValue, oldValue) {
if (newValue !== this.originalValue) {
this.triggers.clear.setVisible(true);
}
}
}
},
},
triggers: {
clear: {
cls: 'pmx-clear-trigger',
weight: -1,
hidden: true,
handler: function() {
this.triggers.clear.setVisible(false);
this.setValue(this.originalValue);
store.clearFilter();
},
},
},
},
);
let availableColumns = {