call show_contextmenu

606 views
Skip to first unread message

Zsolt Demi

unread,
Dec 12, 2010, 3:12:22 PM12/12/10
to jsTree
Dear Group!

Please help me, how to call the show_contextmenu from an onclick
event.

I have created the tree :
$j('#topic_tree_content_tree_container').jstree({
"core" : { "initially_open" : [ "topic_root" ] },

"themes" : {
"theme" : "<?php echo $theme;?>",
"dots" : true,
"icons" : true
},

"plugins":["themes","html_data", "crrm", "contextmenu"] });

I would like to show the context menu from a link - pointing to a tree
node :

<a href='javascript:void(0)'
onclick="$j('#topic_tree_content_tree_container').jstree('show_contextmenu(tree_node_1)');"
>Show Context Menu</a>

Please show me the right format, to call jstree function!
Thank you!

Best Regards
Zsolt

vakata

unread,
Dec 18, 2010, 9:32:20 AM12/18/10
to jsTree
Try using:

$(tree_node_1).children('a').trigger('contextmenu');

Kindest regards,
ivan

MaZe->

unread,
Jan 24, 2011, 9:49:23 AM1/24/11
to jsTree
thanks vakata, this way works, but display the context menu "at
node".
how to attach contextmenu position to an independant action button for
example?

regards

Ivan Bozhanov

unread,
Feb 7, 2011, 4:49:21 AM2/7/11
to jst...@googlegroups.com
Where would you like to show it? You can use the contextmenu plugin on non tree elements too if that is what you need - its not dependent of jstree. You can show it at a position (x,y) or at a node.

Kindest regards,
Ivan

Nagi T

unread,
Oct 28, 2014, 3:07:13 AM10/28/14
to jst...@googlegroups.com

Can you please tell me how to set the position of the context menu 

function GoToProductListReservation(id) {
  
    var node = jQuery('#' + id);
    $(node).children('a').trigger('contextmenu');
    //jQuery('#coursetree').jstree('show_contextmenu', node);
}
 I am using the above method to show context menu on a button click , 
Reply all
Reply to author
Forward
0 new messages