node/Tasks: deselect entries when filter changes

since we use a remotefilter on a bufferedstore, the only event where
we can check if the selected element is still there is the 'refresh'
event. Simply deselect if the seleceted element is not in the store

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-07-05 16:34:00 +02:00 committed by Thomas Lamprecht
parent f00e321173
commit 12a6f6824f

View File

@ -44,6 +44,20 @@ Ext.define('Proxmox.node.Tasks', {
me.getView().updateLayout();
},
refresh: function() {
let me = this;
let view = me.getView();
let selection = view.getSelection();
let store = me.getViewModel().get('bufferedstore');
if (selection && selection.length > 0) {
// deselect if selection is not there anymore
if (!store.contains(selection[0])) {
view.setSelection(undefined);
}
}
},
sinceChange: function(field, newval) {
let me = this;
let vm = me.getViewModel();
@ -144,6 +158,7 @@ Ext.define('Proxmox.node.Tasks', {
},
listeners: {
prefetch: 'updateLayout',
refresh: 'refresh',
},
},
},