Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TreeStore: different behaviour beetween autoLoad configuration and load() function

Tags:

extjs5

The test case in fiddle is working with autoLoad: true but with autoLoad: false (line 86) the load() function called at line 161 in the TreePanel beforerender event does not load the data...

For (non tree) panels I allways have set autoLoad to false and load the store on render of the GridPanel and it works perfectly. I do it like this to prevent loading all the stores at the beginning (and to set filters sometimes).
The beforeload event of the store is preventing double-load.

Where is my fault for this TreeStore ? I am looking for a solution for a long time without any result...

like image 940
Michel Avatar asked Mar 16 '16 20:03

Michel


1 Answers

There has been similar issue in Ext JS 4 explained here ExtJS 4. Hidden treepanel with autoload false .

What I did in your fiddle is that I just added the following

  autoLoad: false,
  root:{
    //expanded: true, // optional
    children: []
  }

to line 91 in your store configuration. Everything worked magically.

like image 174
nenadg Avatar answered Nov 09 '22 18:11

nenadg