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

[Solved] Double click to the child elements

2 Answers 95 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tx3
Top achievements
Rank 1
Tx3 asked on 26 May 2010, 01:11 PM
Hi,

It seems that double-click expands branches which is nice. How can I assign action to double click event of the item? This would be very quick way to navigate instead of selecting an item and then clicking on some button to do an action.

-Tatu

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 26 May 2010, 03:12 PM
Hi Tx3,

You can handle the double click event like this:

<%= Html.Telerik().TreeView()
                  .Name("TreeView")
                  .CilentEvents(events => events.OnLoad("onload"))
%>
<script type="text/javascript">

function onload() {
      $(".t-in", this).live("dblclick", function() {
               var node = $(this).closest('.t-item');
               var text = $(this).text();
       });
}

</script>

I hope this helps,
Atanas Korchev
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
Tx3
Top achievements
Rank 1
answered on 27 May 2010, 12:26 PM
Thanks again, I'll try it right away!
-Tatu
Tags
TreeView
Asked by
Tx3
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Tx3
Top achievements
Rank 1
Share this question
or