RightClicking on tree object and getting an context menu.

Hi,
I am having an layout of dhmIxLayout in that i have an tree object and i need to open a contextmenu onRightClick of tree, have added onRightClick function which was given by dhtmlx docs…I am getting an alert as followed below but i am not getting contextMenu…

repoTree.attachEvent(“onRightClick”, function(id, e){
menu = new dhtmlXMenuObject();
menu.setIconsPath(“images/”);
menu.renderAsContextMenu();
menu.attachEvent(“onClick”, onButtonClick);
menu.loadXML("${path}/dhtmlx/tree/TreeOptions.xml");
alert(id);

So, please can any one help me in this…

Thanks

you need to call menu.show - in moment when context menu need to appear