日期:2014-05-16  浏览次数:20383 次

Ext 给tree的一个结点加了一个click,但是没有反映。
new Ext.tree.Panel({
   width:'100%',
title:'菜单',
//hideHeaders:false,
//renderTo:Ext.getBody(),
height:300,
rootVisible:false, //是否显示ROOT
useArrows:true,
root:{
text:'首页',
children:[
{text:'常用',
children:[{text:'工具'}


]},
{text:'维修管理'},
{text:'资产管理',
children:[{text:'添加资产'},
{text:'调动资产'},
{text:'申请资产'},
{text:'报废资产'}
]
 },
{text:'管理项',
    children:[{text:'添加组织',      listeners:{'click':function(_t,_d){
                                           alert('执行了没有?');
  }
  
  } 
  }]
}
]

}
  
  
  
  })
  

------解决方案--------------------
加载tree配置,不是加到数据源里面

  var tree = Ext.create('Ext.tree.Panel', {
listeners: { itemclick: function (view, record, item, index, e, eOpts) {}},
 
//.....