items:[{ region:'west',//西面放入面板 xtype:'treepanel', split:true,//设置分隔条 collapsible:true,//可以进行缩进 collapseMode:'mini',//设置左右缩减 minWidth:150, maxWidth:300, width:200, root:new Ext.tree.AsyncTreeNode({ text:'权限管理', iconCls:'purviewManagerIcon', expanded:true,//子节点展开 children:[{ text:'用户管理', disabled:true, leaf:true,//true设置此节点为叶子节点 qtip:'用户管理',//提示信息 listeners:{ 'click':function(){ alert(); } } },{ text:'权限管理', iconCls:'purviewManagerIcon', leaf:true,//true设置此节点为叶子节点 qtip:'权限管理',//提示信息 listeners:{ click:function(){ alert(); } } }]
为什么效果是下边图片的结果 用户管理子节点是灰的 还可以进行点击弹出对话框,怎样达到子节点是灰的 不可以点击(注click事件保留的情况下,因为以后要写的代码会用到click事件)
[code="js"]
listeners:{
click:function(事件参数请自行补齐)
{
if(已经disabled)
{
// e是事件参数之一
e.stopEvent();
}else
{
alert();
}
}
}
[/code]