From cc3bcee00ac2bb6af1f5455f130d3883781f67d1 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 21 Feb 2018 15:32:23 +0100 Subject: [PATCH] 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 --- www/manager6/tree/ResourceTree.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js index 78d4cbb0..165ef733 100644 --- a/www/manager6/tree/ResourceTree.js +++ b/www/manager6/tree/ResourceTree.js @@ -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) {