]> git.proxmox.com Git - pve-manager.git/commitdiff
tree: prepare for ExtJS 6.2.0
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Feb 2018 14:32:23 +0000 (15:32 +0100)
committerDominik Csapak <d.csapak@proxmox.com>
Thu, 22 Feb 2018 10:47:04 +0000 (11:47 +0100)
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>
www/manager6/tree/ResourceTree.js

index 78d4cbb0eff02735c8e96cd1343f8a3278e80eda..165ef733dcf108b841afb37513b43eb47f0bf798 100644 (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) {