TreeGrid - context menu not displaying

Hello all,

I have created a simple context menu initialized from json.
Then I attached it to treegrid but the menu does not appear.

Does anybode have the same issue?
I am using dhtmlxSuite v.4.6.1 Professional edition.

[code]gridMenu = new dhtmlXMenuObject(null, “dhx_skyblue”);
gridMenu.renderAsContextMenu();
gridMenu.attachEvent(“onClick”, onMenuItemClick);
gridMenu.loadStruct([
{text: ‘Add’, id:“Add”},
{text: ‘Edit’, id:“Edit”},
]
);

grid = new dhtmlXGridObject(‘gridbox’);
grid.setImagePath("…/libs/dhtmlxTreeGrid/codebase/imgs/");
grid.setHeader(“Building Block,Key,Type,Control Type”);
grid.setInitWidths("*,200,100,100");
grid.setColAlign(“left,left,left,left”);
grid.setColTypes(“tree,ro,ro,ro”);
grid.enableTreeCellEdit(false);
grid.setColSorting(“str,str,str,str”);
grid.attachHeader("#text_search");
grid.setFiltrationLevel(-2);
grid.enableContextMenu(gridMenu);
grid.init();
grid.setSkin(“dhx_skyblue”);
grid.load(“bbeditor/load”,
function() {
grid.selectRow(0);
},
“json”);

            grid.attachEvent("onBeforeContextMenu", function(rowId, colInd, grid) {
                console.log("onBeforeContextMenu: "+rowId);
            });    

[/code]

As you can see I also added a handler for event ‘onBeforeContextMenu’ which is never fired.

Thanks for any help,
Tomas

ok, the solution was to add return true; to “onRightClick” handler

                grid.attachEvent("onRightClick", function(id, e) {
                    console.log("onRightClick: "+id);
                    
                    return true;
                });

It should be written in API doc.
docs.dhtmlx.com/api__dhtmlxgrid_ … event.html

Tomas