I am trying integrating the Spreadsheet component of Vaadin Pro into our web app. It is based on SpringBoot 3.2.2 and Vaadin 24.2.0. The idea is, loading out a number entries from database, and presenting them in a table of the Spreadsheet, and by using the
class SpreadsheetFilterTable I set a filter to each of column of the tables to filter data by values in the column. However, I found that time the filtering takes by using the checkbox associated with the SpreadsheetFilterTable seems to be proportional to the number of rows the table contains. With more than 2 thousands rows of data the user experience is already decreased significantly, when it take over 1 minute by selecting or deselecting 1 filter.
I spent some time to check out how table filtering works. In the class Spreadsheet.class I saw the following method, which is related to table filtering:
public void setRowHidden(int rowIndex, boolean hidden) {
Sheet activeSheet = this.getActiveSheet();
Row row = activeSheet.getRow(rowIndex);
if (row == null) {
row = activeSheet.createRow(rowIndex);
}
row.setZeroHeight(hidden);
SpreadsheetFactory.calculateSheetSizes(this, this.getActiveSheet());
if (this.hasSheetOverlays()) {
this.reloadImageSizesFromPOI = true;
this.loadOrUpdateOverlays();
}
this.getSpreadsheetStyleFactory().reloadActiveSheetCellStyles();
}
I don’t understand why the calls of SpreadsheetFactory.calculateSheetSizes and this.getSpreadsheetStyleFactory().reloadActiveSheetCellStyles are make after setting each row is set to be hidden. If they are called only once.
Has anyone encountered the same issue and does anyone have suggestion to this problem?