ext tree checkbox中选中子菜单,把其对应的父级菜单也选上
现在可以实现选中父级菜单,自动选中其子级菜单。可是选中子菜单不知道怎么可以选中父级菜单。
还有就是怎么可以获得选中菜单的Id.
我知道这个是你想要的,源码和示例都有,采纳我的答案吧:0
http://crepitus.com/misc/ext/tree.html
// private
parentCheck : function(node ,checked){
var checkbox = node.getUI().checkbox;
if(typeof checkbox == 'undefined')return ;
if(!(checked ^ checkbox.checked))return;
checkbox.checked = checked;
node.attributes.checked = checked;
node.getOwnerTree().fireEvent('check', node, checked);
var parentNode = node.parentNode;
if( parentNode !== null){
this.parentCheck(parentNode,checked);
}
}