Hi lixin,
We have
checked your reported query of limiting the row and columns and hiding the
extra rows and columns in spreadsheet with reference to the attached screenshot.
This can be achieved by setting the isFinite property of scrollSettings
to true in our spreadsheet.
And then to
render the rows and columns based on the data occupied, you can set the rowCount
and colCount based on the usedRange
property of the sheet.
For your convenience,
we have prepared a sample, in which we have set the rowCount and colCount
based on the usedRange in the created
event and attached along with
the code snippet below for your reference.
Code Snippet:
|
created: function () {
spreadsheet.merge('Cart!A1:F2');
let sheets = spreadsheet.sheets;
for (var i = 0; i
< sheets.length; i++) {
//Set the rowCount and colCount based
on used range.
sheets[i].rowCount =
sheets[i].usedRange.rowIndex + 1;
sheets[i].colCount =
sheets[i].usedRange.colIndex + 1;
}
//To set the modified sheet property to the Spreadsheet.
spreadsheet.setProperties({ sheets: sheets }, true);
//To refresh the changes in UI.
spreadsheet.resize();
}
|
Sample Link:
https://stackblitz.com/edit/gyqddg-jm3fb5
Also, we have
prepared a video demonstration showcasing the above requirement and attached
below for your reference.
Video Link:
Please refer to the attachment below.
For more
information, you can refer to the UG link mentioned below.
UG Link: https://ej2.syncfusion.com/javascript/documentation/spreadsheet/scrolling#finite-scrolling-with-defined-rows-and-columns
Kindly, check
the above details and get back to us for further clarifications.
Regards,
Dinakar M
Attachment:
VideoF191516_2882fdf6.zip