OnClientNodePopulated is invoked too early

4 posts, 0 answers
  1. Paweł
    Paweł avatar
    2 posts
    Member since:
    May 2012

    Posted 22 May 2012 Link to this post

    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
  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 25 May 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paweł
    Paweł avatar
    2 posts
    Member since:
    May 2012

    Posted 25 May 2012 Link to this post

    I did this, but I thought there was some more elegant solution.
  5. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 25 May 2012 Link to this post

    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.
Back to Top