This article mainly introduces the Easy UI dynamic tree click text to realize the expansion and closing function. Friends who need it can refer to it. I hope it can help everyone.
Just click on the tree function at the JSP and add a piece of code:
The whole thing is as follows:
<span style="white-space:pre"> </span>$("#tt").tree({ onClick: function(node){ if(node.url != null){ parent.frames["content"].location.href="${ctx}" rel="external nofollow" + node.url; }else{ if(node.state=='closed'&&(!$("#tree").tree('isLeaf',node.target))){ //状态为关闭而且非叶子节点 $(this).tree('expand',node.target);//点击文字展开菜单 }else{ $(this).tree('collapse',node.target); } } } })
Related Recommendation:
Use "function recursion" to implement a dynamic tree menu based on php and MySQL
To implement a dynamic tree menu based on php and MySQL Menu_PHP Tutorial
Implementing a dynamic tree menu based on PHP and MySQL
The above is the detailed content of Implementation of Easy UI dynamic tree click text to expand and close functions. For more information, please follow other related articles on the PHP Chinese website!