Client side code "click"

6 posts, 0 answers
  1. Mark
    Mark avatar
    12 posts
    Member since:
    May 2008

    Posted 19 May 2008 Link to this post

    Hello,

    We need to simulate node click event on client side. We tried to use client side select() method, but this method does not cause postback, like expand() method for example. 

    Is there client side method that equivalent to user click action? Or may be there is a workaround for the problem?

    Regards,
    Olga
  2. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 19 May 2008 Link to this post

    Hi Mushon Nachmias,

    Please try using the select function instead, as it will do a postback as required.

    Here you can read more about it.

    Best wishes,
    Simon
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Mark
    Mark avatar
    12 posts
    Member since:
    May 2008

    Posted 19 May 2008 Link to this post

    Hi Simon,

    Instead of what?
    select() method does not cause postback, as I wrote in my first post.

    Thanks
  4. Mark
    Mark avatar
    12 posts
    Member since:
    May 2008

    Posted 19 May 2008 Link to this post

    Hi Simon,

    I have found the following in Telerik's documentation:

    Selects or unselects a Node based on the boolean parameter.

    If selecting a Node with a mouse does postback, calling the set_selected(true) function will select the Node but will NOT do postback.

    Regards,
    Olga

  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 22 May 2008 Link to this post

    Hello Mushon Nachmias,

    The select() function selects a Node but a postback will occur only if you had handled the OnNodeClick server-side event of the RadTreeView; otherwise a postback will not occur although the Node will get selected on the client.

    I hope this helps.

    All the best,
    Simon
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Eric
    Eric avatar
    8 posts
    Member since:
    Aug 2008

    Posted 06 Jul 2011 Link to this post

    A quick addendum to the replies posted here.

    I had a need to trigger the client side "click" event of a tree node programmatically in response to a user initiated click of a context menu item. To accomplish this using the client API you can do something like the following:

     

    function ContextMenu_onClientMenuItemClicking(sender, e){
        e.get_node().get_textElement().click();
    }

    Simple, but effective. I have only tested this in IE9, but I believe it should work in most browsers. Hope this helps someone else.
Back to Top