I want to the control to not go into Click callback when Double click on the node in fancytree
Asked
Active
Viewed 768 times
2 Answers
0
This is standard browser behavior, Fancytree does not do anything special about the click events.
However: from jQuery help (http://api.jquery.com/dblclick/):
It is inadvisable to bind handlers to both the click and dblclick events for the same element. The sequence of events triggered varies from browser to browser, with some receiving two click events before the dblclick and others only one. Double-click sensitivity (maximum time between clicks that is detected as a double click) can vary by operating system and browser, and is often user-configurable.

mar10
- 14,320
- 5
- 39
- 64
0
You're giving very little to work with, so I'll give you a general double click implementation example.
HTML
<input type="button" id="yourControl">
JS
var waitingForSecondClick = false;
$(document).ready(function() {
$('#yourControl').click(function() {
if (waitingForSecondClick) {
waitingForSecondClick = false;
onDoubleClick();
} else {
waitingForSecondClick = true;
setTimeout(function() { waitingForSecondClick = false}, 300);
}
return false;
});
function onDoubleClick() {
alert('Double clicked!');
}
});

iuliu.net
- 6,666
- 6
- 46
- 69