[]
You can control the visibility and scrolling behavior of workbook scrollbars.
Use showHorizontalScrollbar and showVerticalScrollbar to control scrollbar visibility.
These properties support three values:
true — Always show the scrollbar
false — Always hide the scrollbar
"auto" — Show the scrollbar only when the worksheet has scrollable content
When set to "auto", the scrollbar is automatically hidden if the content fully fits within the viewport.
spread.options.showHorizontalScrollbar = "auto";
spread.options.showVerticalScrollbar = "auto";
In "auto" mode, the scrollbar is also hidden if:
All rows and columns fit within the viewport
Frozen rows or columns eliminate all scrollable area
Note: When exporting to Excel,
"auto"is treated astruebecause Excel does not support automatic scrollbar visibility.
You can adjust how the scrollbar determines its scrollable range.
scrollbarMaxAlign: Aligns the scrollbar with the last row and column of the active sheet.
scrollbarShowMax: Calculates the scrollbar range based on the total row and column count.
spread.options.scrollbarMaxAlign = true;
spread.options.scrollbarShowMax = true;
Use scrollIgnoreHidden to exclude hidden rows and columns from scrollbar calculations.
Hidden rows and columns include:
Zero height or width
Rows or columns hidden using the visible method
Collapsed grouped rows or columns
Filtered-out rows
spread.options.scrollIgnoreHidden = true;