filter([filter])

Class: Table.

Description:

Sets row filter expression which can be a combination of conditions similar to if() condition in JavaScript.

Setting the filter hides rows that don't match specified filter criteria. When filter is set to "", filter gets cleared and all rows become visible again.

See examples below.

Parameters:

Name Type Description

[filter]

string

Filter to use to display only rows that meet the specified conditions. Default is "" (no filter).

Returns:

Returns this Table when setting filter, otherwise returns current filter.

Type: Table | string

Examples:

// Using case insensitive regular expression
table.filter(`column(1) regex "(?i)^Jim.*"`);
// Filtering by numeric value
table.filter("column(1) < 50");
// Filtering by date
table.filter(`column(3) > "2023-04-01 00:00:00" && column(3) < "2024-05-30 00:00:00"`);
// Filtering by a boolean for checkbox
table.filter("column(4) != false");