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

OnClientNodeExpanded fires too early

6 Answers 99 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lighthouse Developer
Top achievements
Rank 1
Lighthouse Developer asked on 30 Mar 2010, 11:06 AM
For my tastes, anyway. It seems that it fires the moment the user clicks on the expand icon. I want an event that fires when the node is expanded, which frankly is what I expected...Any solution for that? I want it for some code that has something to do with height so I need to get the final expanded height. I tried using a timer with a delay longer than the animation duration but no luck. Any help would be appreciated.

6 Answers, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 30 Mar 2010, 12:46 PM
Hello,

This was done to prevent the case where the user collapses the node before it's fully expanded and the ClientNodeExpand is never fired. This could cause problems in some scenarios, but you are right that some scenarios (especially those that rely on checking the height of the TreeView/Node) require an event that is fired after the Node is fully expanded/collapsed. That's why we are planning to add something like AnimationEnd event so we can cover both scenarios without breaking existing functionality.

Interestingly, using a timeout set to the duration of the animation should work as a workaround. What was the problem you encountered in this case?

Best wishes,
Dimitar Milushev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Lighthouse Developer
Top achievements
Rank 1
answered on 30 Mar 2010, 12:50 PM
It sometimes works and it sometimes doesn't. The code appears solid since if I run it from Firebug after the nodes have expanded it works as it should...
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 30 Mar 2010, 12:57 PM
I got exactly the same problem. Solved by

function onNodeExpanded(sender, args)
{
setTimeout("SetGroupHeight()", 50);
}
0
Dimitar Milushev
Telerik team
answered on 30 Mar 2010, 01:12 PM
Hello,

If the timeout doesn't work every time, try increasing the delay slightly so it is a bit longer that the duration of the animation. The timeout delay is not very precise in most browsers which could be causing the erratic behavior.

Greetings,
Dimitar Milushev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Lighthouse Developer
Top achievements
Rank 1
answered on 30 Mar 2010, 01:51 PM
I have. I even explicitly defined the animation time and put an almost double that delay...
0
Dimitar Milushev
Telerik team
answered on 07 Apr 2010, 04:54 PM
Hello,

It is confirmed that the next RadControls Service Pack, scheduled for next week, will include a new client-side event for RadTreeView, OnClientNodeAnimationEnd, which should solve this and similar problems.

Kind regards,
Dimitar Milushev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Lighthouse Developer
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Lighthouse Developer
Top achievements
Rank 1
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or