Dhtmlx tree menu

On my dhtmlx tree professional we bought, I am using the menu. I have couple of questions on that.



1. Can it be made context depending on node�s data selected.

2. When I right click to get the menu, how do I also select that node. Basically click that node as well.





Your immediate response will be much appreciated.



Anil



1.    Can it be made context depending on node’s data selected.
The context menu has onShow event which can be catched to show|hide
menu items according to selected item in tree. Please check attached
sample.

    cMenu.setOnShowMenuHandler(function(id){
        //id - id of item in tree
        //hide|show items in menu here
    });


> 2.    When I right click to get the menu, how do I also select that node. Basically click that node as well.

Can be done by using the same event
    cMenu.setOnShowMenuHandler(function(id){
        //id - id of item in tree
        //hide|show items in menu here
        tree.selectItem(id,true);
    });