本来是用dwz框架,结果异步加载树比较麻烦,就结合用easyui tree,实现异步加载树;但问题是单击文字不能展开折叠,网上也查了,最后用以下方法比较简单实现,可供参考。
在jquery.easyui.min.js文件中, 找到onSelect函数,加入 $(this).tree(node.state === 'closed' ? 'expand' : 'collapse', node.target); 句话即可,如下:
onSelect:function(node){
$(this).tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
}