PDA

View Full Version : TreeStrore is getting loaded twice even though autoLoad set to false



suryanarendra
16 Aug 2012, 12:17 PM
Hi,


I am having a problem with the ExtJS4 Tree Store. Even though autoLoad set to false, the store is getting loaded twice. In my case I am using JSON reader to parse the JSON response,
and "rootVisible" is set to false in the view class.


My TreeStore code is:

Ext.define('xxx.HostHierarchy', {
extend:'Ext.data.TreeStore',
autoLoad:false,

proxy:{
type:'ajax',
api:{
read:'/xxx/hostsview.json'
},
reader:{
type:'json',
totalProperty:'total',
successProperty:'success',
root:'data'
}
}
});

After some search & debug, I found out that if rootVisible property set to false, then expanded property of root will be set to true which triggers multiple requests. To avoid this I added

setRootNode : function (node) {
var me = this;
if(node != undefined)
node.expanded = false;
},

But its not working. Can somebody please suggest me how to avoid this. Because of this multiple load, on my UI screen all tree nodes are appearing twice.

ExtJS version is 4.0.5.

Thanks and Regards,
Nari

scottmartin
16 Aug 2012, 4:38 PM
Please see if you still have this problem with 4.1.1 GA.

Scott.