-
7 Oct 2011 6:23 AM #1
Answered: How to stop TreeStore autoload?
Answered: How to stop TreeStore autoload?
I have a tree with a store Ext.data.TreeStore.
Whenever the store is created the data is autoloaded. The parameter autoLoad: false.
Ext.define('MyStore', {
extend: 'Ext.data.TreeStore',
fields: ['id', 'text'],
autoLoad: false,
proxy: {
type: 'ajax',
url: 'some.url'
},
root: {
expanded: true
}
});
I need to pass some parameters into url prior loading and I know the parameters only after everything is rendered, so how can I stop the autoloading?
-
Best Answer Posted by psewt
-
9 Oct 2011 11:50 PM #2Sencha - Community Support Team
- Join Date
- Nov 2007
- Location
- Helsingborg, Sweden
- Posts
- 2,461
- Vote Rating
- 56
- Answers
- 29
Code:root: { expanded: false }
-
10 Oct 2011 8:12 AM #3
This works only if for 'Ext.tree.Panel' 'rootVisible: false'.
The problem is that I need it with invisible root, but when it's set to invisible then the root automatically expands and than it loads. Seems to me like bug that we cannot set the rootVisible without firing the load.
Any other solution?
-
10 Oct 2011 10:16 AM #4
Try it with children and autoLoad : false
Code:root: { children : [] }
-
10 Oct 2011 3:15 PM #5
What about just not configuring a root node? When you're ready for the (invisible) root node to load just call setRootNode() with the relevant details:
http://docs.sencha.com/ext-js/4-0/#!...od-setRootNode
-
11 Oct 2011 2:50 AM #6
-
11 Oct 2011 10:26 AM #7
Can you mark the answer as "Best Answer" to close the thread?
Thanks


