April 2018
Intermediate to advanced
202 pages
4h 48m
English
We can start by configuring the columns we actually want to show in the Grid. Since the columns were automatically created by the constructor, we can set their visibility by name using the setColumns method:
... private void initLayout() { ... grid.setColumns("firstName", "lastName", "email", "mainRole"); ... }...
In contrast to the previous editable Grid, we don't need the Password column here, since we are not using an Editor.
We can continue by adding a click listener to the refresh button, and implementing the refresh method. This is pretty straightforward:
... private void initBehavior() { grid.asSingleSelect().addValueChangeListener(e -> updateHeader()); refresh.addClickListener(e -> refresh()); } public ...Read now
Unlock full access