mbraak / jqTree

Tree widget for jQuery
https://mbraak.github.io/jqTree/
Apache License 2.0
1.02k stars 177 forks source link

[Proposal] clickNode function #157

Closed billmn closed 9 years ago

billmn commented 11 years ago

I notice that exists selectNode, openNode, ... functions but doesn't exists a function to simulate a node click.

Something like this :

var node = $tree.tree('getNodeById', 123);
$tree.tree('clickNode', node);

thoughts ?

mbraak commented 11 years ago

In which situation would you use the clickNode function?

billmn commented 11 years ago

At now in any specific situation but I think can be useful to call commands in the "tree.click" event. Now exist methods to trigger all the jqTree events (excluding "tree.contextmenu") but not for "tree.click".

Mine is not a request but a simple proposal because I think that was a missing function.

Super Low Priority :)

Gaboli commented 10 years ago

is clickNode implemented ? or is there anything similar function ?

mbraak commented 10 years ago

You can select a node using the selectNode function.

There is no clickNode function.

Gaboli commented 10 years ago

but selectNode does not trigger the click event for that node.

mbraak commented 10 years ago

I think it does trigger the tree.select event.

If you really want the click event, then perhaps there is a way to trigger it somehow.

odungern commented 9 years ago

.. when walking the tree using the keys, the 'tree.select' event is triggered nicely. So it is easy to connect a function to this event:

In my case this works just fine. When a new node is selected via keyboard or mouse-click, the function is called, thus the object displayed in its place.