I'm having a lot of trouble with the ext5 trees, so I figured I'd post here and see what you guys have noticed, and hopefully help you through these 5.0.0 bugs...
The TreeStore appears to load twice if I set it to
autoload:true
. Because of this, it somehow duplicates the nodes shown in the treepanel, causing all sorts of issues/errors...
So, in creating a work-around, I set the TreeStore to
autoload:false
and tried to just grab the store and load it, after the view was rendered. [fail]. The TreeStore loads just the one time, but the tree failed to actually render. Again, nothing was changed except having the store set to not autoload, and dropping this into the controller:
var s = Ext.getStore('myStore');
s.load();
No tree would get painted...
So, workaround number two (AWFUL solution) - let the store autoload (with the two proxy calls), but after the tree renders, remove all the data, then load the store again manually.
(in the store)
...
autoload: true
...
(in the controller)
...
var s = Ext.getStore('myStore');
s.removeAll();
s.load();
...
Shazam! The tree loaded the final time, and only has the data represented once! No duplication!!
However, now all the expanding and collapsing is broken. No events are firing, no expanding and collapsing of the nodes works.... Maybe the collapse/expand was already broken?
Set autoload:true, take out the controller code.
TreeStore loads twice; duplicate nodes in the treepanel; expand/collapse work properly.
I've since found a work-around, while sencha "fixes" this issue...
Here's the workaround that I've just decided to put into every single store, so nothing like this happens again:
...
listeners: {
beforeload: function (store, operation, eOpts) {
if(store.isLoading()) return false;
}
}
...
By adding this in, no store will ever "double load." It's just kind of ridiculous that we have to put this type of work-around in...
Good luck guys!