GWT CellTable: Add / Remove Row in CellTable

Is GWT CellTable designed to display only records and update existing ones.

Is it possible to add and remove a record from CellTable, any pointers to a stable solution.

thanks

+4
source share
2 answers

You can add and remove rows of data by manipulating a model object that supports CellTable display.

ListDataProvider<OrderLineWeek> model = new ListDataProvider<OrderLineWeek>(); model.addDataDisplay(myCellTableInstance); 

You can then access the list through model.getList() , but you must call model.refresh() or table.setRowCount(model.getList().size()) if you added or removed any rows.

Hope this helps.

+6
source
 ListDataProvider.getList().remove(index); DataGrid.redraw(); // to refresh 

to add, create an object, then assign data to this object,

 ListDataProvider.getList.Add(object); DataGrid.redraw(); 
+4
source

Source: https://habr.com/ru/post/1399531/


All Articles