Event Handler for Context Menu for Grid Header



This solution will give me handler for right as well as left click.
I specifically want handler for only right click as its for normal context menu.
Your knowledge base provided me with mygrid.hdr.oncontextmenu but as said on above link
its not working.

What’s the problem if I use
mygrid.hdr.oncontextmenu = function(e){

I want to use this handler only because I have cracked how to get column Id for particular header
using this event handler.
And other problem with “onHeaderClick” is that its called even on left click which is not helpful in my case
In v 1.6 same kind of handler is available, how can v2.1 restrict the user from what was provided in v1.6
Provide the solution asap.


Try to add following construction to your code:
var button = (e||event).button;
if (button == 2)