context menu desnt shows if the grid is empty

i encount the problem same as the:
viewtopic.php?f=2&t=472&p=1317&hilit=grid+empty+menu#p1317

and the anwser:
aMenu=new dhtmlXContextMenuObject(‘120’,0);

aMenu.setContextZone(mygrid.objBox,“empty_space”);

can not slove the problem now,can you help me?

Try to use following code:

mygrid.loadXML(url,function(){ if (!mygrid.getRowsNum()) { mygrid.entBox.id="menu_context_id"; menu.addContextZone("menu_context_id"); } });