Home > Web Front-end > JS Tutorial > body text

Implementation of Easy UI dynamic tree click text to expand and close functions

小云云
Release: 2017-12-27 09:39:02
Original
1496 people have browsed it

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==&#39;closed&#39;&&(!$("#tree").tree(&#39;isLeaf&#39;,node.target))){ //状态为关闭而且非叶子节点 
           $(this).tree(&#39;expand&#39;,node.target);//点击文字展开菜单  
         }else{ 
           $(this).tree(&#39;collapse&#39;,node.target); 
         } 
      } 
       
    } 
  })
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!