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

Cancel Event Propogation in ClientDoubleClick

5 Answers 37 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Kevin Warnke
Top achievements
Rank 1
Kevin Warnke asked on 09 Jun 2010, 05:08 AM
I want to use args.set_cancel(true) in the javascript of the ClientDoubleClick event but that method doesn't seem to be available on the args variable for ClientDoubleClick.

Any thoughts?

Thanks,
Kevin

5 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 09 Jun 2010, 05:05 PM
Hi Kevin Warnke,

Well, there is no set_cancel() method, because there is no associated action with the double-click event itself. We fire a separate nodeExpanding or nodeCollapsing events after doubleClick that can be cancelled.

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
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
Kevin Warnke
Top achievements
Rank 1
answered on 09 Jun 2010, 07:21 PM
That's just it, though.

If someone expands a node themselves it needs to work.  But if they double-click a node I want to perform my own action INSTEAD of expanding the node.

What would you recommend to meet this requirement?

Thanks,
Kevin
0
Nikolay Tsenkov
Telerik team
answered on 10 Jun 2010, 01:35 PM
Hello Kevin Warnke,

As I previously said "We fire a separate nodeExpanding or nodeCollapsing events after doubleClick that can be cancelled."

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
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
Kevin Warnke
Top achievements
Rank 1
answered on 10 Jun 2010, 03:03 PM
I think I asked the wrong question :)

How can I tell in the nodeExpanding event that it is expanding because of a double click and not because the user clicked the [+] symbol next to the node?

Thanks,
Kevin
0
Nikolay Tsenkov
Telerik team
answered on 10 Jun 2010, 11:01 PM
Hi Kevin Warnke,

Well, you can create a flag variable, for example, raise it on double click and check if it's raised in the nodeExpanding handler:
var isDoubleClick = false;
 
// handler of ClientDoubleClick
function onClientDoubleClick()
{
   isDoubleClick = true;
}
 
// handler of ClientNodeExpanding
function onClientNodeExpanding(sender, args)
{
   if (isDoubleClick)
   {
      ...
      isDoubleClick = false;
   }
   else
   {
      ...
   }
}

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
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.
Tags
TreeView
Asked by
Kevin Warnke
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Kevin Warnke
Top achievements
Rank 1
Share this question
or