I am not completely sure with what you mean by putting changes to the grid, but I suppose you are using setItems or a data provider?
For the first, you would have:
Grid<MyItem> grid = new Grid(MyItem.class);
grid.setItems(someItems);
While for the second you would write:
Grid<MyItem> grid = new Grid(MyItem.class);
grid.setDataProvider(...);
For the second way you can either specify the data provider using Java 8 notation as in:
grid.setDataProvider(
(sortOrders, offset, limit) -> {//e.g. call to repo },
() -> { // count provider, e.g. repo.count() });
or as in:
grid.setDataProvider(new ListDataProvider<>(myDataCollection));
To come to the question, in both cases you can call following to get the provider:
DataProvider<MyItem> provider = grid.getDataProvider();
To update one specific element, the data provider provides the method
provider.refreshItem(item);
Important to know is that the MyItem class has to implement a getId()
method, or, alternatively, equals()
. If this is not the case, you can invoke provider.refreshAll()