Skip to content

Freeze columns

This section covers the methods to handle with the spreadsheet freeze columns.

The following methods are available to interact with the spreadsheet freeze columns programmatically.

MethodDescription
getFreezeColumnsGet the current value of the freezeColumns property.

`Jspreadsheet getFreezeColumns(): Promise<number
setFreezeColumnsSet the value of the freezeColumns property.
@param column - new value.

Jspreadsheet setFreezeColumns(column: number): Promise<void>
POST /api/:guid/freeze/columns
import { Client } from "@intrasheets/client";
// Create a new client
const client = new Client({
// API Server
baseUrl: "http://localhost:8009/api",
// Your authentication token
token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",
});
// Spreadsheet Guid
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
// Get the spreadsheet instance
const spreadsheet = client.getSpreadsheet(guid);
// Freeze two columns
spreadsheet.setFreezeColumns(2).then(() => {
// It worked correctly
}).catch((err) => {
// Something went wrong
console.log(err);
});
import { Client } from "@intrasheets/client";
// Create a new client
const client = new Client({
// API Server
baseUrl: "http://localhost:8009/api",
// Your authentication token
token: "eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i",
});
// Spreadsheet Guid
const guid = '79b45919-c751-4e2b-a49a-6c1286e2fc03';
// Get the spreadsheet instance
const spreadsheet = client.getSpreadsheet(guid);
// Get freeze columns
spreadsheet.getFreezeColumns().then((freezeColumns) => {
console.log(freezeColumns);
});