Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tejas Shah on Jun 12, 2009 06:49
open dhtmlx forum
DHX Grid: setContextZone for Column context menu.

Hi there,
What will be zoneId for creating the column menu i.e. context menu for Column header in grid.
In v1.6 I used

for (var i = 0; i < mygrid.getColumnsNum(); i++) {
mymenu.setContextZone(mygrid.hdr.rows[1].cells[i],i);
}
for assigning zone for Column Header Context Menu.
But since setContextZone is not available for v21. I tried using addContextZone(zoneId) function.
Now I am wondering what will be zoneId in this case because "mygrid.hdr.rows[1].cells[i]" is not an Id
infact its an object so I am getting zone is null when I tried running this example.

Please provide the solution asap. (If possible provide an example for context menu for v2.1)

Answer posted by Alex (support) on Jun 12, 2009 07:22

Hello,

in this case you can define header id - and addContextZone method will be available:

...

mygrid.hdr.id= "h_cmenu";
mymenu.addContextZone("h_cmenu");