Tutorial: Trimming

Trimming


Edit on GitHub

Overview

The Trim Rows plugin allows excluding selected rows from rendering.

Setup

To enable the plugin, you need to set the trimRows property to an array of row indexes.
See the examples section for a live demo.

Example

Notice, that the second, third and sixth rows are missing.

API examples

You can access the plugin instance by calling

var plugin = hot.getPlugin('trimRows');

To trim a single row, call the trimRow method of the plugin object:

plugin.trimRow(4);

To trim multiple rows, you can either pass them as arguments to the trimRow method, or pass an array of indexes to the trimRows method:

plugin.trimRow(0, 4, 6);
// or
plugin.trimRows([0, 4, 6]);

To restore the trimmed row(s), use the following methods:

plugin.untrimRow(4);

plugin.untrimRow(0, 4, 6);

plugin.untrimRows([0, 4, 6]);

To see the changes you made, call hot.render(); to re-render the table.