This is a migrated thread and some comments may be shown as answers.

Problem with collapsing tree node on client side

1 Answer 32 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jaimin
Top achievements
Rank 1
Jaimin asked on 31 Jul 2008, 12:04 PM

Hi,

I faced a problem while collapsing node on client side. Consider following example: There are 3 root nodes in the tree when I click on collapse button the below function executes but it only collapses the first expanded node. The below function is taken from the Rad examples only...
Secnario:
R1
    C1R1
    C2R2
R2
    C1R2
    C2R2
R3
    C1R3

When I click on collapse button only first node collapses and tree looks like:
R1
R2
    C1R2
    C2R2
R3
    C1R3

When I again click on collapse button second node collapses and tree looks like:
R1
R2
R3
    C1R3

 

function Collapse()

{

//get the explorer tree

var explorerTree = $find("<%= rtvExplorer.ClientID %>");

//get the root node count

var nodeCount = explorerTree.get_nodes().get_count();

//loop through root node and collapse them

for (var loopCount=0; loopCount<nodeCount; loopCount++)

{

var node = explorerTree.get_nodes().getNode(loopCount);

alert("node text : " + node.get_text() + ", loopCount : " + loopCount + ", nodeCount : " + nodeCount);

node.set_expanded(false);

}//for

}//function [Collapse]

Has anyone came across with this situation and found the solution???

Thanks and Regards,
Jaimin

 

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 01 Aug 2008, 06:33 AM
Hi Jaimin,

Thank you for contacting us.

I tested the provided code and wasn't able to reproduce the problem. Please check the attached sample project.
Could you modify it and send it back to us so we can observe the problem? You should open a support ticket to send us files. Thanks

Best wishes,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Jaimin
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or