GWT offers table where we can specify column types, and make rows data modifiable.
CellTable supports paging and columns, i have not used paging in this example but only specified the columns for text and button.
Column
class defines the Cell
used to render a column.Implement
Column.getValue(Object)
to retrieve the field value from the row object that will be rendered in the Cell
.
and the data which will be rendered:
You can use TextCell instead of EditTextCell, in case you do not want to make column editable.
DataProvider, ListDataProvider can display data which should be provided as list.
I have used modal User to create few items in the list and provide the same to the ListDataProvider and which works as the modal for the celltable.
Remove row from the dataProvider and table.
When user clicks on "x" update gets called from updater and where we can remove the row from the modal and refresh modal and re-draw table (i found without refresh modal and redraw table call also it was working fine).
Example files are available to download <<==== click here to download.
Look for GwtExamples.rar (v.1)
thank you very much, your example was very useful for the project I do
ReplyDeleteThank you for existing. You saved me from madness.
ReplyDeletehello,
ReplyDeletedo you have example for GWT updating/adding data to a celltable/DataGrid?
Thank you, from Colombia
ReplyDeleteThank You
ReplyDeleteThank You
ReplyDelete