Posted 2 March 2023, 2:09 am EST - Updated 2 March 2023, 2:19 am EST
Columns responsive
Posted by: pedro.moraes on 2 March 2023, 2:09 am EST
-
-
Posted 5 March 2023, 12:51 am EST
Hello,
Please note that whenever there are more rows or columns that can fit the viewport, extra rows/columns are not displayed. They are only displayed by scrolling them to the viewport. The columns width in SpreadJS do not automatically expand or shrink when the viewport width increases or decreases. This is by design and matches with the behavior in MS Excel. However if you want to display the fixed number of columns with the viewport, then you can get the width of viewport using sheet.getViewportWidth() method and set the width of all the columns accordingly using sheet.setColumnWidth() method.
Please explain your use case in more detail so that we could assist you accordingly.
Sample:https://jscodemine.grapecity.com/share/4P83aAcjAU2J-GMQNH-emA/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}
doc referencesheet.getViewportWidth(): https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Worksheet#getviewportwidth
sheet.setColumnWidth(): https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Worksheet#setcolumnwidth
Regards,
Avinash