Extjs tree节点的点击事件 [问题点数:80分,结帖人Q11253217]
楼主
发表于: 2013-08-28 15:38:05
我想做一个类似如下图的界面
![]() 然后点击左边tree的节点在中间区域能够生成一个tab界面。不同节点点击的时候进入的页面不同 代码如下:求监听事件怎么写
width="728" height="90" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" id="aswift_1" name="aswift_1" style="box-sizing: content-box; left: 0px; position: absolute; top: 0px;">
| |||
![]() |
#1 得分:0
回复于: 2013-08-28 16:06:03
给你的treepanel添加一个 监听吧,
|
#2 得分:0
回复于: 2013-08-28 16:12:09
能不能举个例子的说。我老是获取不到节点 | |
![]() |
#3 得分:10
回复于: 2013-08-28 16:14:49
给你的那个treepanel加一个这个试试 | ||
#4 得分:0
回复于: 2013-08-28 16:21:48
这样弹出来的时候说我node.id未定义 | |
![]() |
#5 得分:0
回复于: 2013-08-28 16:27:58
![]() 假设定义的为treepanel
| ||
#6 得分:70
回复于: 2013-08-28 16:57:30
加错误位置了吧。。 items: [{ xtype: 'treepanel', title: '系统菜单', expanded: true, listeners: { itemclick: function (view, record, item, index, e, eOpts) { if (record.get('leaf')) { //叶子节点 var id = record.get('id'); if (Ext.getCmp(id)) tab.setActiveTab(id); else tab.add({ title: record.get('text'), html: 'tab内容--' + record.get('text'), closable: true, id: id }); } } }, containerScroll: true, root: { | |
#7 得分:0
回复于: 2013-08-28 17:59:36
大神就是大神啊,十分感谢 | |||
#8 得分:0
回复于: 2013-08-28 18:07:22
如果我想在tab里显示的内容是不同的页面怎么显示,就是相当于这边节点对应不同的页面 | |||
#9 得分:0
回复于: 2014-03-11 17:00:09
![]() 大神啊,我太崇拜你啦 |