Columns and cell properties

This section covers the methods to manage the properties from a cell or a spreadsheet column.

Documentation

getProperty (cell)

Get the properties of one cell.

Parameter Description
column Cell column.
row Cell row.

GET /api/:guid/:worksheetIndex/properties/:column/:row

getProperty (columns)

Get the properties of one or more columns.

Parameter Description
columns Column(s) position(s). If omitted, the properties of all columns are returned.

GET /api/:guid/:worksheetIndex/properties/:columns

setProperty (columns)

Set the properties of one or more columns. All old properties are removed.

Parameter Description
properties.[].column Column number.
properties.[].options Properties values. If omitted, current settings will be removed.

POST /api/:guid/:worksheetIndex/properties

setProperty (cell)

Set the properties of a cell. All old properties are removed.

Parameter Description
properties[].column X coordinate.
properties[].row Y coordinate.
properties[].options Properties values. If omitted, current settings will be removed.

POST /api/:guid/:worksheetIndex/properties

updateProperty (columns)

Update the properties of one or more columns. Only the specified properties are affected.

Parameter Description
properties.[].column Column number.
properties.[].options Properties values.

POST /api/:guid/:worksheetIndex/properties/update

updateProperty (cell)

Update the properties of a cell. Only the specified properties are affected.

Parameter Description
properties[].column X coordinate.
properties[].row Y coordinate.
properties[].options Properties values.

POST /api/:guid/:worksheetIndex/properties/update

resetProperties

Removes all properties of a cell.

Parameter Description
column Cell column.
row Cell row.

POST /api/:guid/:worksheetIndex/properties

Examples

Column properties

Update the column properties

const baseUrl = 'http://localhost:8009/api';
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
const token = 'eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i';
const headers = { 'Authorization': `Bearer ${token}` };

// Change the properties from the forth column
await fetch(`${baseUrl}/${guid}/0/properties`, {
    method: 'POST',
    headers,
    body: new URLSearchParams({
        'properties[0][column]': '3',
        'properties[0][options][type]': 'checkbox',
        'properties[0][options][title]': 'Column A',
        'properties[0][options][width]': '100',
    }),
});

Read the properties of a column

const baseUrl = 'http://localhost:8009/api';
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
const token = 'eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the properties from the first column
const properties = await (await fetch(`${baseUrl}/${guid}/0/properties/0`, { headers })).json();

console.log(properties);

Read the properties of multiple columns

const baseUrl = 'http://localhost:8009/api';
const guid = '15eb1171-5a64-45bf-be96-f52b6125a045';
const token = 'eyJhbGciOiJIUzUxMiIsInR5cCJ9.eyJkb21haW4iOiJsb2NhbGhvc3Q6ODAPQSJ9.Xr2Ir2-zEc_tqV5y6i';
const headers = { 'Authorization': `Bearer ${token}` };

// Get the properties from multiple columns
const properties = await (await fetch(`${baseUrl}/${guid}/0/properties/0,1`, { headers })).json();

console.log(properties);