EasyUI Forum
November 05, 2025, 03:03:04 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Expand the node when using setValues function  (Read 10882 times)
vinod
Newbie
*
Posts: 4


View Profile
« on: October 25, 2012, 06:50:06 AM »

I need help in expanding the node while using the function setValues.

example:
   
Folder1
    File1
    Folder2
        File2
        Folder3
            File31
            File32


In the above example if I am passing the node-id of the child "file32" to the function setValues. Then the nodes "Folder2", "Folder3" should automatically be expanded.

I am using the following code.
 <script>
 $(document).ready(function () {
     $('#cc').combotree('setValues', 1,2,20,40,10);   
});
</script>

« Last Edit: October 25, 2012, 07:17:39 AM by vinod » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 25, 2012, 05:53:33 PM »

Call 'expandTo' method of tree to expand all the parent nodes of specify node. Please try the following code:
Code:
var c = $('#cc');
c.combotree('setValue','file32');
var t = c.combotree('tree');  // get tree object
var node = t.tree('find', 'file32');  // find the specify node
t.tree('expandTo', node.target);
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!