Reputation: 9761
I would like to achieve the following behavior with my tree.
When someone select the corner icon that signal that the node is expandable, i would like the node to expand and only expand (no selection). Meanwhile, when someone select the node (i.e. one click the text of the node), i want that a specific handler that i made be executed and no expansion of the node.
This is because in my application, when a user select/one click an element of the tree, the element is added, to another list within the html. Let say a list of selected item.
So in other words:
When someone oneclick the text of a node, the node should not expand at all, and only my handler should be executed.
In the mean time, if someone one click, the icon on the left corner of a node (which actually signal that the node is expandable), i would like it to expand only and nothing else.
In short, is it possible to distinguish between the selection of a node and the action of expanding it.
Upvotes: 1
Views: 401
Reputation: 918
Setting clickFolderMode
to 1
will get you the behavior you're after:
When someone select the corner icon that signal that the node is expandable, i would like the node to expand and only expand (no selection). Meanwhile, when someone select the node (i.e. one click the text of the node), i want that a specific handler that i made be executed and no expansion of the node.
$("#tree").fancytree({
clickFolderMode: 1 // 1:activate, 2:expand, 3:activate and expand
});
You should then be able to use the onSelect
and onExpand
event handlers to do what you need to depending on which action the user performed.
Upvotes: 1