Monday, October 3, 2011

Re: Adding a context menu to DataGrid

Subclass the TextInputCell, override the getConsumedEvents(),
onBrowserEvent() method. To edit the property in
Collections.singleton("contextmenu") in getConsumedEvents method. Add
this as Column.

//.java

class TestTextInputCell extends TextInputCell
{
public TestTextInputCell()
{
super();
}

@Override
public Set getConsumedEvents()
{
return Collections.singleton("contextmenu");
}

public void onBrowserEvent(Cell.Context context, Element parent,
Object value, NativeEvent event)
{
event.preventDefault();
event.stopPropagation();
}
}

S. Abraham
www.DataStoreGwt.com
Persist objects directly in GAE


On Oct 3, 10:26 am, Karan Nih <vlin...@gmail.com> wrote:
> Can some one please tell me how to add a context menu to a DataGrid in
> GWT
> I am using GWT 2.4
>
> Thanks

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment