Freeze columns
This section covers the methods to handle with the spreadsheet freeze columns.
Documentation
Section titled “Documentation”Methods
Section titled “Methods”The following methods are available to interact with the spreadsheet freeze columns programmatically.
| Method | Description |
|---|---|
| setFreezeColumns | Set the value of the freezeColumns property. @param column - new value. Jworksheet setFreezeColumns(columns: number[] | null): Promise<void> POST /api/:guid/:worksheetIndex/freeze/columns |
Examples
Section titled “Examples”Update the freeze columns configuration
Section titled “Update the freeze columns configuration”import { Client } from "@intrasheets/client";
// Create a new clientconst client = new Client({ // API Server baseUrl: "http://localhost:8009/api", // Your authentication token token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",});
// Spreadsheet Guidconst guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
// Get the spreadsheet instanceconst spreadsheet = client.getSpreadsheet(guid);
// Get Jworksheet objectconst worksheet = spreadsheet.getWorksheet(0);
// Freeze two columnsworksheet .setFreezeColumns([2, 3]) .then(() => { // It worked correctly }) .catch((err) => { // Something went wrong console.log(err); });curl -X POST "http://localhost:8009/api/79b45919-c751-4e2b-a49a-6c1286e2fc03/0/freeze/columns" \ -H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i" \ -H "Content-Type: application/json" \ -d '{ "column": [2, 3] }'