我希望能够选择文件夹节点标签来展开树,同时还为树调用 onClick 函数。我已将树的 openOnClick 属性设置为 true,这将使树在选择节点标签时展开,但是永远不会调用 onClick 函数。
我的代码看起来像这样......
tree = new Tree({
model: treeModel,
openOnClick : true, // This prevents onClick function from firing
onClick: function(item, node, event){
// this function is never called because openOnClick is enabled
alert("This message will never appear");
},
}, "tree");
我需要 openOnClick 和 onClick 才能工作。我正在使用道场 1.9
有任何想法吗???