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

OnClientNodePopulated is invoked too early

3 Answers 21 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paweł
Top achievements
Rank 1
Paweł asked on 22 May 2012, 01:53 PM
I'm trying implement something like this:
1. User clicks button that is placed somewhere on the page
2. RadTreeView expands some nodes (ServerSideCallback is used for nodes) to show some node
3. RadTreeView is scrolled to show this node (there are many nodes in the tree)

The problem is that OnClientNodePopulated is called before nodes are showed, so scrollIntoView method doesn't scroll to this node.
Is there any event that occurs after nodes are showed?

Browser: IE 8

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 25 May 2012, 11:51 AM
Hi Pawel,

 There is no such event that occurs after the nodes are shown so I will recommend you to use some setTimeout according to your case as it is done in the function below:

function OnClientNodePopulated(sender, args) {
          setTimeout(function() { args.get_node().get_nodes().getNode(7).scrollIntoView(); }, 200);
      }

Hope this will be helpful.Kind regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Paweł
Top achievements
Rank 1
answered on 25 May 2012, 12:13 PM
I did this, but I thought there was some more elegant solution.
0
Plamen
Telerik team
answered on 25 May 2012, 01:22 PM
Hello Pawel,

 
In this scenario this is the most efficient solution that we could think of so far. If you can think of a better one please share it with the community.

All the best,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TreeView
Asked by
Paweł
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Paweł
Top achievements
Rank 1
Share this question
or