PDA

View Full Version : TreePanel and TreeStore



undersun
24 Jul 2013, 10:04 PM
Hello!
If I have this code, TreeStore call 'myAwesomeUrl'

Ext.create('Ext.tree.Panel', {
height: 150,
width: 200,
rootVisible: false,
title: 'Simple Tree',
renderTo: Ext.getBody(),
store: Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'myAwesomeUrl'
}
})
});

But, if I comment or set rootVisible: true, store don't send any requests

Ext.create('Ext.tree.Panel', {
height: 150,
width: 200,
// rootVisible: false,
title: 'Simple Tree',
renderTo: Ext.getBody(),
store: Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'myAwesomeUrl'
}
})
});

Farish
24 Jul 2013, 11:12 PM
Try setting expanded: true on your root config in treestore:

http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.TreeStore-cfg-root