Extjs tree节点的点击事件,该怎么解决

Extjs tree节点的点击事件
我想做一个类似如下图的界面
Extjs tree节点的点击事件,该怎么解决
然后点击左边tree的节点在中间区域能够生成一个tab界面。不同节点点击的时候进入的页面不同
代码如下:求监听事件怎么写
var tab = new Ext.TabPanel({
region : 'center',
deferredRender : false,
activeTab : 0,
resizeTabs : true, // turn on tab resizing
minTabWidth : 115,
tabWidth : 135,
enableTabScroll : true
});

Ext.onReady(function() {
var viewport = new Ext.Viewport({
width : 1024,
height : 620,
layout : 'border', // border布局
items : [{
region : 'north', // 必须用region参数指定位置
xtype : 'panel',
height : 50,
frame:true,
split : false, // split属性是设置除了center区域外是否可调节大小
html : '欢迎登录!',
margins : '0 0 0 0'

// title: 'South Region is collapsible', //要想设置折叠必须设置title
// collapsible: true
}, {
region : 'south', // 必须用region参数指定位置
xtype : 'panel',
height : 50,
frame:true,
split : false, // split属性是设置除了center区域外是否可调节大小
html : '欢迎登录!',
margins : '0 0 0 0'
// title: 'South Region is collapsible', //要想设置折叠必须设置title
// collapsible: true
}, {
title : 'West Region is collapsible',
region : 'west',
xtype : 'panel',
width : 200,
collapsible : true, // 设置可折叠
id : 'west-region-container',
layout : 'fit',
margins : '0 0 0 0',
title : '管理系统',
items : [{
xtype : 'treepanel',
title : '系统菜单',
expanded : true,
containerScroll : true,
root : {
text : '系统管理',
children : [{
text : '行政区划管理',
id : 'c1',
                                expanded : true,
children : [{
text : '行政区划管理1',
id : 'c11',
leaf : true
}, {
text : '行政区划管理2',
id : 'c12',
leaf : true
}]
/*
 * href:"Grid.html",//节点的链接地址
 * hrefTarget:"tab"//打开节点链接地址默认为blank,可以设置为iframe名称id,则在iframe中打开
 */}, {
text : '部门管理',
id : 'c2',
expanded : true,
children : [{
text : '部门管理1',
id : 'c21',
leaf : true
}, {
text : '部门管理2',
id : 'c22',
leaf : true
}]
}, {
text : '用户管理',
                                expanded : true,
id : 'c3',
children : [{
text : '用户管理1',
id : 'c31',
leaf : true
}, {
text : '用户管理2',
id : 'c32',
leaf : true
}]
}, {
text : '菜单管理',
expanded : true,
id : 'c4',
children : [{
text : '菜单管理1',
id : 'c41',
leaf : true
}, {
text : '菜单管理2',
id : 'c42',
leaf : true
}]
}]
},
viewConfig : {

}
}],
dockedItems : [{
xtype : 'toolbar',
dock : 'bottom',
items : [{
text : "全部折叠",
listeners : {
"click" : {
fn : function() {
this.collapseAll();
},
scope : this
}
}
}]
}]

}, tab// 初始标签页
]

});

});

------解决方案--------------------

listeners:{
        click : function(node,e){
                alert(node.id); 
        }
}

给你的那个treepanel加一个这个试试
------解决方案--------------------
引用:
Quote: 引用: