Freeze columns
The spreadsheet freeze columns property helps to sticky some columns floating left on the spreadsheet. The property can be defined programmatically as below:
Documentation
Methods
Define or reset the number of freeze columns programmatically.
Method | Description |
setFreezeColumns(number) |
Set the freeze columns.
setFreezeColumns(number: number) : void |
resetFreezeColumns() |
Reset the freeze columns.
resetFreezeColumns() : void |
Initial Settings
The following property is available through the initialization of the online spreadsheet.
Property | Description |
freezeColumns: number | Define the number of freeze columns on initialization. |
freezeColumnControl: boolean Premium | Enable freeze column manual control. Default: false |
Examples
Basic freeze column usage.
It is possible to define the viewport when using the freeze columns, as follow:
Source code
<html>
<script src="https://jspreadsheet.com/v9/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<div id="spreadsheet"></div>
<script>
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('NDU5MzI2OGEwYTAyMzU3YjAyMmYwMzQxM2IxYzYyNjg2NzU2ODVkNTkzZTkxY2UzNGZmM2RjN2EwZjBjYzk5NjViNTlkMTMxNjFjOTBjZWU4N2U2YWI0ZWQ5MDEwM2IxZjAyZjIxOGRhOTZjMDY4MzRkZTU3MTYxZjkwODI1NDQsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UWTVOalE1TmprMU1Dd2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWQyVmlJaXdpYkc5allXeG9iM04wSWwwc0luQnNZVzRpT2lJek5DSXNJbk5qYjNCbElqcGJJblkzSWl3aWRqZ2lMQ0oyT1NJc0luWXhNQ0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owSWl3aVltRnlJaXdpZG1Gc2FXUmhkR2x2Ym5NaUxDSnpaV0Z5WTJnaUxDSndjbWx1ZENJc0luTm9aV1YwY3lKZExDSmtaVzF2SWpwMGNuVmxmUT09');
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
minDimensions: [50,20],
tableOverflow: true,
tableWidth: '800px',
freezeColumns: 2
}]
});
</script>
</html>
Enable manual freeze controls Premium
Enable the interface controls for manual adjustments.
Source code
<html>
<script src="https://jspreadsheet.com/v9/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<div id="spreadsheet"></div>
<script>
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
minDimensions: [50,20],
tableOverflow: true,
tableWidth: '800px',
freezeRowControl: true,
freezeColumnControl: true,
}]
});
</script>
</html>