I was on this, but it appears I never enter in my test. When I right-
clik on the header, it opens the standard browser context-menu.
Below my code :
private class RightClickableHeader extends SafeHtmlHeader {
public RightClickableHeader(SafeHtml headerHtml, String
columnId, String datatype) {
super(headerHtml);
sinkEvents(Event.ONMOUSEDOWN | Event.ONMOUSEUP |
Event.ONCONTEXTMENU);
}
@Override
public void onBrowserEvent(Context context, Element elem,
final NativeEvent event) {
if((event.getButton() & NativeEvent.BUTTON_RIGHT) >0) {
Window.alert("Right click!");
} else {
super.onBrowserEvent(context, elem, event);
}
}
}
On 15 sep, 12:58, Jeff Larsen <[email protected]> wrote:
> if contextmenu isn't sunk by all browsers ( I haven't tested EVERYWHERE, but
> it does where chrome, ie8, 9, firefox) you can always grab the native event,
> check for the click event then nativeEvent.getButton() ==
> NativeEvent.BUTTON_RIGHT
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.