FlowingCode / GridExporterAddon

Apache License 2.0
10 stars 9 forks source link

Doesn’t work fine with frozen columns #56

Closed cqrendo closed 7 months ago

cqrendo commented 1 year ago

If you define a frozen column col.setFrozen(true) then the scroll lateral doesn’t work fine, see next videos:

in the first video “fase" is frozen and exporter is not activate , all the other columns are scroll, but not export function is show frozen column 2

in the second video “fase" is frozen and exporter is activate, then none of the columns of the grid are scroll it frozen column

In the third video any column is frozen and exporter is activate, then works fine the columns in the grid are scroll it but only with out frozen
frozen column 3

javier-godoy commented 1 year ago

Hello.

Grid doesn't work well when there is a joined footer that covers both frozen and not-frozen columns. The component logs the following warning in the browser console: image

This behavior is discussed in https://github.com/vaadin/flow-components/issues/3363, https://github.com/vaadin/flow-components/issues/1064

As a workaround, you can disable the footer generated by the component (setAutoAttachExportButtons(false)) and provide your own footer that is only joined for the rightmost unfrozen columns.

For instance, if the second column is frozen, you can add a joined footer that starts on the third column

grid.appendFooterRow();
grid.getElement().getThemeList().add("hide-first-footer");
FooterRow fr = grid.appendFooterRow();
FooterCell footerCell = fr.join(grid.getColumns().stream().skip(2).toArray(Grid.Column[]::new));
footerCell.setComponent(toolBar);

Alternatively, you can froze both the first and the second column, and add a joined footer that only covers those columns,

This workaround does not help if the rightmost column is frozen (see https://github.com/vaadin/flow-components/issues/5035)

javier-godoy commented 1 year ago

Issue reported upstream.

mlopezFC commented 7 months ago

Closing because we provided workarounds and there was no activity in the issue since then.