[su_icon_text icon=”icon: info-circle” icon_color=”#5b63df” class=”saki-info-box”]Code in this post can be obsolete, however, principles and theory may still apply.[/su_icon_text]
Ext.BLANK_IMAGE_URL = '../ext/resources/images/default/s.gif';
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
var children = [{
text:'First Level Child 1'
,children:[{
text:'Second Level Child 1'
,leaf:true
},{
text:'Second Level Child 2'
,leaf:true
}]
},{
text:'First Level Child 2'
,children:[{
text:'Second Level Child 1'
,leaf:true
},{
text:'Second Level Child 2'
,leaf:true
}]
}];
Ext.onReady(function(){
var tree = new Ext.tree.TreePanel({
loader:new Ext.tree.TreeLoader()
,width:200
,height:400
,renderTo:Ext.getBody()
,root:new Ext.tree.AsyncTreeNode({
expanded:true
,leaf:false
,text:'Tree Root'
,children:children
})
});
});
Building A Tree From Static Data
I'm a well seasoned developer, consultant and educator of web applications based mainly on Sencha libraries, PHP, MySQL and Node.js. Besides (Apple) computers, I love photography and mountain biking.
Follow me:
Latest posts by saki (see all)
- Ext, Angular, React, and Vue - 27. June 2019
- The Site Resurgence - 11. February 2018
- Configuring ViewModel Hierarchy - 19. June 2015