ContexMenu loading from string not working


I just need to display one item in context menu (edit) and here is my code

menu = new dhtmlXMenuObject(null, “standard”);




menu.attachEvent(“onClick”, onButtonClick);

menu.loadXML("<?xml version='1.0' ?>");

I attached the context menu to treeGrid


but I am getting an error “Incorrect XML”. I don’t want to use the XML file to load contextMenu. Please suggest.

Cotext menu in such case is a instance of dhtmlxMenu. You can use any available dhtmlxMenu API method for the variable “menu”.

To load menu from the xml string you should use method menu.loadXMLString("<?xml version='1.0' ?>").

You can find more information about data loading in dhtmlxMenu here … menu_vxak0