TreeGrid: ContextMenu according TreeNode

I have a treeGrid.
I have defined a contextual Menu (right click with treeGrid.setContextMenu)

How to define a contextual Menu according the current treeNode (node actif with the right click) ? I would like to have different contextual menu elt according the current treeNode.

No response for my post, i will detail a little more:

The tree:

node1
-node1.1
-node1.2
-node1.3

I would like to have different contextual menus regarding tree node:

for node1.1, i would like to have action1 and action2
for node1.2, i would like to have action3 only

How can i do this functionality ?

getSelectedRecord() will give you the node that was right clicked on, because right clicks change the selection.

let me know how to get the name of the node clicked from a tree…