前面一篇文章实现了业务系统的整体布局(《ExtJS4.X Boder 布局实现系统页面框架》),接下来我们来实现一个经常使用的菜单,前台不用说当然是使用Ext,后台代码使用C#,最终实现了一个动态加载菜单并且点击菜单后实现Tab页的加载。 首先说下treestore的数据结构,treestore就是treepanel的本地构建的数据源 01 var store = Ext.create('Ext.data.TreeStore', { 02 root: { 03 expanded: true, 04 children: [ 05 { text: "会员管理", leaf: true }, 06 { text: "系统管理", expanded: true, children: [ 07 { text: "权限管理", leaf: true }, 08 { text: "管理员管理", leaf: true} 09 ] }, 10 { text: "业务管理", leaf: true } 11 ] 12 } 13 }); 看完上面的treestore,我们大概知道了treestore接受的json有如下一些东西: 1 {id:'01',text:'a01',children:[ 2 {id:'01-01',text:'a01-01',leaf:true}, 3 {id:'01-02',text:'a01-02',children:[ 4 {id:'01-02-01',text:'b01-02-01',leaf:true},