Skip to content

Commit

Permalink
Fix performance issue in Grid initial render with Footer (#10705)
Browse files Browse the repository at this point in the history
* Fix performance issue in Grid initial render with Footer
  • Loading branch information
tsuoanttila authored and Ilia Motornyi committed Mar 13, 2018
1 parent 867ea63 commit 5deec67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,9 @@ protected void init() {

Grid<JsonObject> grid = getWidget();

// Remove default headers when initializing Grid widget
while (grid.getHeaderRowCount() > 0) {
grid.removeHeaderRow(0);
}
// Trigger early redraw of both grid static sections.
grid.setHeaderVisible(!grid.isHeaderVisible());
grid.setFooterVisible(!grid.isFooterVisible());

registerRpc(GridClientRpc.class, new GridClientRpc() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ protected void setup(VaadinRequest request) {
.setWidth(200);
}
grid.setItems(IntStream.range(0, 10).boxed().map(i -> ""));
grid.appendFooterRow();
addComponent(grid);
}
}

0 comments on commit 5deec67

Please sign in to comment.