tree: prepare for ExtJS 6.2.0

Remove the expand/collapse hack needed for an earlier ExtJS version.

Further do not collapse the rootnode before restoring the state, it
may not be collapsible at this time, as it may be still seen as leaf
node, and thus throws exceptions with ExtJS 6.2.0

we fired the refresh to late for the store, i moved it up to fire
directly after we resume events on the store, i.e. when our store update
window is closed again. So it happens before applying the state and
expanding the rootnode.

see
https://pve.proxmox.com/pipermail/pve-devel/2018-February/030762.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2018-02-21 15:32:23 +01:00 committed by Dominik Csapak
parent 1f2c48153b
commit cc3bcee00a

View File

@ -186,8 +186,6 @@ Ext.define('PVE.tree.ResourceTree', {
groupinfo.leaf = false;
groupinfo.groupbyid = v;
group = me.addChildSorted(node, groupinfo);
// fixme: remove when EXTJS has fixed those bugs?!
group.expand(); group.collapse();
}
if (info.type === groupby) {
return group;
@ -346,6 +344,7 @@ Ext.define('PVE.tree.ResourceTree', {
});
store.resumeEvents();
store.fireEvent('refresh', store);
// select parent node is selection vanished
if (lastsel && !rootnode.findChild('id', lastsel.data.id, true)) {
@ -363,13 +362,11 @@ Ext.define('PVE.tree.ResourceTree', {
// on first tree load set the selection from the stateful provider
if (!pdata.updateCount) {
rootnode.collapse();
rootnode.expand();
me.applyState(sp.get(stateid));
}
pdata.updateCount++;
store.fireEvent('refresh', store);
};
var statechange = function(sp, key, value) {