dhtmlxgrid contextmenu issue

Hi,

I have issue creating context menu to grid. I see object expected js error.Here is my code.
Please help me out if you see any issue. I see error when trying to add a contextzone( menu.addContextZone(grid); ).

When tried same code using mozilla, using firebug I could see "b is null " error in dhtmlx.js at line 1188. Please let me know what needs to be passed to addContextZone()?


my_layout = new dhtmlXLayoutObject(document.body, "4W");
var gridObj = my_layout.cells("c").attachGrid();

menu = new dhtmlXMenuObject();
menu.addNewSibling(null, "add", "ADD ROW", false);
menu.renderAsContextMenu();
gridObj.enableContextMenu(menu);
menu.hideItem("add");

function showMenu(rowId, celInd, grid){     
   menu.addContextZone(grid);       
   menu.showItem("rename");
       
 }

gridObj.attachEvent("onBeforeContextMenu", showMenu);

Please, have a look at the working sample of context menu in dhtmlxGrid:
dhtmlx.com/docs/products/dht … _menu.html

If issue still occurs - please, provide a complete sample of init of your grid and menu.