Removing empty menu bar when using context menu in a cell

Is there a way of removing the empty menu bar when using attachMenu() in a cell? The menu is to be used as a context menu.



I set the text for the cell with

layout.cells(“a”).setText(“Test”);

and when I then add

menu = leftLayout.cells(“a”).attachMenu();

I get an empty bar below the cell header with “Test”



I want use the context menu with a tree in the same cell using

tree.enableContextMenu(menu);




If you want to use context menu, you shouldn’t use attachMenu() method.


Try to use the common way of context menu intialization:


menu = new dhtmlXMenuObject();

menu.renderAsContextMenu();



and then you can attach it to the tree:


tree.enableContextMenu(menu);



Thanks Alex that worked,
I had attached the menu to a cell in the layout and so used attachMenu() but then decided to use a tree in the cell and attach to this instead but I did not realise I had to change the attach method.

Yes, we use attachMenu() to attach a horizontal menu to a cell. For context menu - new dhtmlXMenuObject().