Closed GoogleCodeExporter closed 8 years ago
[deleted comment]
to keep the original action if not DblClick event exist:
if(o.onDblClick && dtnode.getEventTargetType(event)!='expander') {
var originalEvent = event;
this.onClickTimeout = setTimeout(function(){ dtnode._onClick(originalEvent); }, 250);
event.preventDefault();
return false;
} else return dtnode._onClick(event);
Original comment by eric.bla...@gmail.com
on 17 Sep 2011 at 11:21
I don't understand the bug you are reporting.
What's wrong with the current onDblClick behavior?
Original comment by moo...@wwwendt.de
on 18 Sep 2011 at 11:11
[deleted comment]
Sorry, I'm french,
I just say I need to enable a DblClick on a root folder
+Folder Node <= here the DblClick is not available, dblClick only open and
close folder
|
--Child Nodes <= here the DblClick work fine
Original comment by eric.bla...@gmail.com
on 18 Sep 2011 at 9:42
Original comment by moo...@wwwendt.de
on 19 Sep 2011 at 5:32
Thats because the default option handles click to expand a folder.
Try this option:
clickFolderMode: 0,
Original comment by moo...@wwwendt.de
on 20 Oct 2011 at 8:12
No, "clickFolderMode: 0" disable the single-clicking to open the folder.
The idee is to keep the single click to open the folder and allow a callback
function on the dblClick event
Original comment by eric.bla...@gmail.com
on 20 Oct 2011 at 8:26
The code I've sent works fine for me ! I open this bug only to give help if
someone else have this problem.
Original comment by eric.bla...@gmail.com
on 20 Oct 2011 at 8:29
We need something similar to this as well.
Single click: expand node as normal
Double click: onDblClick event handler
We could not get it to work.
Original comment by bjohnson...@gmail.com
on 16 Oct 2013 at 4:43
Why is the status now "Invalid"?
The onDblClick event should be fired on double click -- regardless of clicked
node is a parent or a leaf node.
It just makes no sense to prohibit handling double clicks on parent nodes.
Original comment by jscho...@gmail.com
on 15 May 2014 at 2:20
'now' was 2011 ;-)
I will look into it again, if I find time...
Original comment by moo...@wwwendt.de
on 18 May 2014 at 6:57
Thank you :)
I attached a minimal example to test this issue.
Original comment by jscho...@gmail.com
on 19 May 2014 at 2:20
Attachments:
clickFolderMode=3 (the deafult mode) does acitvate and expand folders on single
click,
but calls preventDefault(), so no dblclick is generated.
Changing this behavior might break existing use cases, I think.
A workaround might be to set clickFolderMode to 1 (activate only).
Then implement mode 3 (activate + expand) yourself.
$('#tree').dynatree({
clickFolderMode: 1, // activate only, but don't prevent dblclick events
onClick: function(node, event) {
// implement clickFolderMode 3: acitvate and expand folders on click
if( node.data.isFolder ) {
node.toggleExpand();
}
},
onDblClick: function(node, event) {
// this event will gegenerated now
},
children: treeData
});
But note that we might get TWO click events now before dblklick, so toggling
may get triggered twice.
So mixing dblclick and click behavior might not be a good idea anyway.
Any thoughts?
Original comment by moo...@wwwendt.de
on 25 May 2014 at 2:34
Original comment by moo...@wwwendt.de
on 25 Dec 2014 at 8:17
Original issue reported on code.google.com by
eric.bla...@gmail.com
on 17 Sep 2011 at 11:01