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

OnClientDoubleClicking property missing?

5 Answers 51 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 12 Jan 2011, 11:43 AM
Hi guys,

Am I doing something silly here, looking at the documentation for the RadTreeView (http://www.telerik.com/help/aspnet-ajax/tree_overviermigrating.html) I see there should be a method OnClientDoubleClicking that would allow me to hook into the handling of a double-click and cancel under certain conditions.

However, I only see OnClientDoubleClick which occurs too late for what I need to do.

Frustratingly I can see OnClientNodeClicked and OnClientNodeClicking so what's going on? And yes I've tried a dummy method using the same signature and it doesn't fire.

Any ideas?

thanks

5 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 12 Jan 2011, 05:46 PM
Hi Andrew,

About the name specified in the migration guide - the correct event name is ClientDoubleClick.

About the too late firing:
 - Handling, both, click and double-click on the node is not supported by RadTreeView. Simply, because the browser always fires a click before the dblclick event.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Andrew
Top achievements
Rank 1
answered on 12 Jan 2011, 05:54 PM
Hi Nikolay, thanks for the prompt reply.

Yes I found that click gets fired together with double-click which is a pain but I'd hoped to work around this by intercepting the double-click to cancel it out, while leaving the single click to do the job of expanding the node - which is the functionality I need.

Are you saying that the documentation is wrong when it notes the OnClientDoubleClicking as well as the OnClientDoubleClick properties for the control?

thanks
0
Nikolay Tsenkov
Telerik team
answered on 13 Jan 2011, 05:29 PM
Hi Andrew,

In order to toggle the nodes in TreeView on single click, you only need to handle the ClientNodeClicked event, get the node from the event arguments (args.get_node()) and expand it (node.set_expanded(true)).

About the documentation:
 - Yes, this is a mistake in our documentation and we will correct it. Thanks for reporting this to our team!


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Andrew
Top achievements
Rank 1
answered on 13 Jan 2011, 05:46 PM
Ok thanks.

The problem is however, the built-in Telerik functionality is overriding the click handler call to expand the node which was why I needed to intercept and cancel the double-click. If the document had been correct I could have at least cancelled the auto Toggle.

As it stands I can use the click event to expand as you say, which was what i was doing incidentally and for single clicks it works. But if the user happens to double-click the node then not only does the click event fire (so my expand call is invoked), but it's immediately followed by an unpreventable double-click that toggles the node closed again. So this I believe means regardless of whether you use double-click handler the control behaviour will still force the node closed again.

It's slightly frustrating given there are *Click and *Clicking varients for most if not all other types of client event.

Is there a workaround option available to allow me to disable the built in double-click handler without me having to dissect the injected JS?
0
Nikolay Tsenkov
Telerik team
answered on 18 Jan 2011, 12:23 PM
Hello Andrew,

If you cancel the click event on ClientNodeClicking and toggle the node in the same event, then you will not have the default dblclick handler acting. But if you double click a node, this will be considered as 2 single clicks by the browser and your handler will cancel them both and toggle twice the node in the initial toggle-state.


Kind regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
TreeView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or