Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 31, 2009 07:54
open dhtmlx forum
context menu for grid

Hi,

Is there any function showcontextmenu which will open the context menu for selected row in the grid.

Thanks.

Answer posted by Support on Mar 31, 2009 08:09
Unfortunately there is no such method, but you can use 
    menu.showContextMenu(x,y)

and calculate x and y as 
   var pos = grid.getPosition(grid.cells(i,j).cell)
   x = pos[0];
   y = pos[1];
Answer posted on Mar 31, 2009 08:28

I am using v.1.6 build 80603 of dhtmlxgrid.js and when I try to use menu.showContextGrid I receive error that its not a function.

Is menu.showContextGrid(x,y) part of higher version?

If yes then can you tell me how can I get this code in my existing version (Note: I also have v.2.0 build 81009 of dhtmlxgrid.js

 ) It would be great if I can just get the necesssary code from the higher version.

Answer posted by Alex (support) on Apr 01, 2009 06:24

showContextMenu (not showContextGrid) is the method of the dhtmlxmenu 2.0 (suite 81009 and higher). The sample is http://dhtmlx.com/docs/products/dhtmlxMenu/samples/init/context.html

Grid PRO 81009 supports the latest menu version. 

In case of using old menu (v1.0) you can use openAt(x,y) method.