How to add id for grid header?

I need to addContextZone to the grid header, so that when it is right-clicked the context menu appears. I am currently managing the clicks on the grid header manually doing sorts of most columns. Special columns require specialized actions invoked by a right-click.

You can add id for the grid header with following code:

mygrid.hdr.id=“header_id”

Now you can use this id to add context zone

Thank you for that helpful tip: mygrid.hdr.id=“header_id”

How do we add an id for each individual column header?

var header_row=mygrid.hdr.rows[1]; for (var i=0; i<header_row.cells.length; i++){ header_row.cells[i].id="context_zone_"+i; }

Thank you for the very helpful answer. I’ve spent many hours trying to figure out how to get context menus to work for individual column headers. I tried to find the DOM elements using IE and FF developer tools, but did not succeed. Please consider adding to your grid documentation how to extend functionality by adding “id’s” to elements making them reference-able.

Thanks again!!! :smiley: