对于业务需求特殊时,在表单展示的combotree需要只能对子节点进行选中,不能选中父节点,直接码代码:
onBeforeSelect : function(node){
if(!$(this).tree("isLeaf", node.target)){
//如果不是叶子节点,不让选择
return false;
}
},
onSelect:function(rec){
//选择是内部赋值处理
}
另注明一点,网上也有许多说法,有这样说用:
onSelect:function(rec){
//判断不为子节点时用
$(node.target).treegrid('unselect');//这个再esayui中是不存在的,虽然也可以使用,但是每次选择父节点时,都会在页面报错
}