3.2.0

howto add "onclik" on header image

I can add an image to a header using grid.setHeaderImage("favorite", 0); but how would I add "onclick" event to that image or "hover" etc... ?
Philippe Marzin
January 30,
You can assign html event handlers directly to the image object using setEvent method -

var header = new AW.Grid.Header;
var image = header.getContent("box/image");
image.setEvent("onclick", function(event){
    alert(1);
    event.cancelBubble = true;
});

obj.setHeaderTemplate(header, 0);
obj.setHeaderImage("favorites", 0);


or use grid onHeaderClicked event and check which element was the event target.
Alex (ActiveWidgets)
January 30,
Thanks - nice and elegant.
Philippe Marzin
January 30,

This topic is archived.

See also:


Back to support forum