OnClientDoubleClicking property missing?

6 posts, 0 answers
  1. Andrew
    Andrew avatar
    3 posts
    Member since:
    Jan 2011

    Posted 12 Jan 2011 Link to this post

    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
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 12 Jan 2011 Link to this post

    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.
  3. Andrew
    Andrew avatar
    3 posts
    Member since:
    Jan 2011

    Posted 12 Jan 2011 Link to this post

    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
  4. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 13 Jan 2011 Link to this post

    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.
  5. Andrew
    Andrew avatar
    3 posts
    Member since:
    Jan 2011

    Posted 13 Jan 2011 Link to this post

    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?
  6. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 18 Jan 2011 Link to this post

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