日期:2014-05-16 浏览次数:20625 次
Ext.regModel("TreeMenu",{
fields:[
{name: 'parentid', type: 'string'},
{name: 'text', type: 'string'}
]
});
var store = new Ext.data.TreeStore({
model:'TreeMenu',
nodeParam:'parentid', //指定节点参数名
proxy:{
type: 'ajax',
url: 'TreeMenu.aspx',
reader:'json'
},
autoLoad:true,
root:{
text:'根节点',
parentid:'-1'
}
});
var treenode = Ext.create('Ext.tree.Panel',{
store: store,
columns:[{
xtype:'treecolumn',
dataIndex:'text',
sortable:true
}],
width:250,
height:150,
lines:false,
useArrows : true,
rootVisible:false,
rootVisible: false
});
[{id:"1",menucode:"xhfp",text:"发票管理",parentid:"0",leaf:false,iconCls:""},
{id:"2",menucode:"tjcx",text:"统计查询",parentid:"0",leaf:false,iconCls:""},
{id:"3",menucode:"jczl",text:"基础资料",parentid:"0",leaf:false,iconCls:""},
{id:"4",menucode:"qxgl",text:"权限管理",parentid:"0",leaf:false,iconCls:""},
{id:"5",menucode:"xtsz",text:"系统设置",parentid:"0",leaf:false,iconCls:""}]
sorters:[{
property:'text',
direction:'ASC'
}]