Class: TrimRows

TrimRows

The plugin allows to trim certain rows. The trimming is achieved by applying the transformation algorithm to the data
transformation. In this case, when the row is trimmed it is not accessible using getData* methods thus the trimmed
data is not visible to other plugins.

Example
const container = document.getElementById('example');
const hot = new Handsontable(container, {
  date: getData(),
  // hide selected rows on table initialization
  trimRows: [1, 2, 5]
});

// access the trimRows plugin instance
const trimRowsPlugin = hot.getPlugin('trimRows');

// hide single row
trimRowsPlugin.trimRow(1);

// hide multiple rows
trimRowsPlugin.trimRow(1, 2, 9);

// or as an array
trimRowsPlugin.trimRows([1, 2, 9]);

// show single row
trimRowsPlugin.untrimRow(1);

// show multiple rows
trimRowsPlugin.untrimRow(1, 2, 9);

// or as an array
trimRowsPlugin.untrimRows([1, 2, 9]);

// rerender table to see the changes
hot.render();

Methods

destroy()

Destroys the plugin instance.

disablePlugin()

Disables the plugin functionality for this Handsontable instance.

enablePlugin()

Enables the plugin functionality for this Handsontable instance.

isEnabled(){Boolean}

Checks if the plugin is enabled in the handsontable settings. This method is executed in Hooks#beforeInit
hook and if it returns true than the AutoRowSize#enablePlugin method is called.

Returns: {Boolean}

isTrimmed(){Boolean}

Checks if given physical row is hidden.

Returns: {Boolean}

trimRow(row)

Trims the row provided as physical row index (counting from 0).

Parameters:
Name Type Description
row Number repeatable

Physical row index.

trimRows(rows)

Trims the rows provided in the array.

Parameters:
Name Type Description
rows Array.<Number>

Array of physical row indexes.

Fires:

untrimAll()

Untrims all trimmed rows.

untrimRow(row)

Untrims the row provided as row index (counting from 0).

Parameters:
Name Type Description
row Number repeatable

Physical row index.

untrimRows(rows)

Untrims the rows provided in the array.

Parameters:
Name Type Description
rows Array.<Number>

Array of physical row indexes.

Fires:

updatePlugin()

Updates the plugin state. This method is executed when Core#updateSettings is invoked.