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