3.0 beta 2

How do I attach a context menu to the grid body?

Hello Everybody!

Is it possible to attach a "oncontextmenu" event to the grid body?

I have a grid with a height of 500px. In the upper half of the grid some rows are visible and the lower half is empty. Now I attached a contextmenu to the rows with:

var rowt = new Active.Templates.Row;
rowt.setEvent("oncontextmenu", function(event){this.action("menu")});
grid.setTemplate('row', rowt);

As expected the contextmenu appears when I right click while I'm over a row.

Now the same should happen if I right click in the lower half of the grid where no rows are shown.

What is the trick?

Thank you for helping.

Best regards.
November 3,
I found it myself:

Simple attach the event to the grid body by setting:

setEvent("oncontextmenu", function(event){alert('contextmenu');});



as Eventhandler does not work. The action "menu" is not fired for unknown reasons.
November 3,

This topic is archived.

See also:

Back to support forum


Version 2

Looking for AW 2.6 ?
The old site is here.