我想使JSON在Extjs樹中工作,這將有助於簡化編輯。extjs樹模式的JSON結構
{
name: '.',
department: [{
name:'Basic Ext Layouts',
expanded: false,
Maths:[{
name:'Absolute',
id:'absolute',
leaf:true,
},{
name:'Accordion',
id:'accordion',
leaf:true
},{
name:'Anchor',
id:'anchor',
leaf:true
},{
name:'Border',
id:'border',
leaf:true
},{
name:'Card (TabPanel)',
id:'card-tabs',
leaf:true
},{
name:'Card (Wizard)',
id:'card-wizard',
leaf:true
},{
name:'Column',
id:'column',
leaf:true
},{
name:'Fit',
id:'fit',
leaf:true
},{
name:'Table',
id:'table',
leaf:true
},{
name:'vBox',
id:'vbox',
leaf:true
},{
name:'hBox',
id:'hbox',
leaf:true
}]
},{
name:'Custom Layouts',
bilology:[{
name:'Center',
id:'center',
leaf:true,
},{
name:'Custom Layouts 2',
zoology:[{
name:'Center',
id:'left',
leaf:true
}]},{
name:'Custom Layouts 3',
botony:[{
name:'Center',
id:'right',
leaf:true
}]}]
},{
name:'Combination Examples',
English:[{
name:'Absolute Layout Form',
id:'abs-form',
leaf:true
},{
name:'Tabs with Nested Layouts',
id:'tabs-nested-layouts',
leaf:true
}]
}]
}
請幫
你檢查ExtJS的文檔? http://docs.sencha.com/ext-js/3-4/#!/api/Ext.tree.TreePanel – 2012-02-23 07:44:25
是的,我做了很多研發,但沒有得到結果。我需要js代碼,它將以這種格式創建樹。我想給出一個deoartment的名字,而不僅僅是一個「children:」節點。 – Dhananjay 2012-02-23 07:47:43