Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Apex 5 treeview

mnonoluNov 23 2016 — edited Feb 17 2017

Hello all,

I am trying to use the context menu plugin integrated in the Apex 5 treeview library or at least to select programmatically an item of the trevieew on right click. The idea is to display a contextual menu when a user right clicks on a treeview node and get back the id of the selected node into that menu.

I have read the forum threads, different interresting articles but I still cannot figure out how to do that. I have also read the code of widget.treeView.js that is not documented but it is quite difficult for me to understand how to use it.

I know I can retrieve the id of the selected data node using $('#MYTREE#).treeView("getSelectedNodes")[0].id;

This works well if a tree node has been previously selected. I know it is possible to define a context menu using this library, but I do not understand how and how to retrieve the id of the concerned node in that context.

I could also use another Jquery contextual menu and retrieve the id using the previous working statement, but I would like to avoid the user to right click the node before left click to render the menu. The idea was then to select the treeview node programmatically on right click.

I have seen setSelectedNodes and setSelection in the library but I do not know how to use them and what the calls should look like (how and what to pass as parameter).

Any example of doing one of theses two things or help on this would be really appreciated.

Thanks in advance.

Regards,

Mno

This post has been answered by Tom Petrus on Nov 27 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2017
Added on Nov 23 2016
7 comments
3,457 views