Filtering

Column Filters

LyteNyte Grid lets you filter data by applying filters to individual columns. Use the filterModel property on the grid to control which columns have filters applied.

The column filter model consists of key/value pairs, where each key is a column id and each value is the filter to apply. This section covers simple filters, available in both Core and Enterprise editions of LyteNyte Grid. The Enterprise edition also supports:

Applying Column Filters

Apply a column filter by setting the filter value for a column in the filterModel property of grid state.

Simple Filter
TODO

LyteNyte Grid offers several types of simple filters to handle diverse filtering requirements.

Text Filter

Use text filters to filter columns with textual values. These filters support common operations like begins_with and contains.

Text Filter
TODO

Number Filter

Apply number filters to columns containing numeric values. Like text filters, number filters support common operations such as less_than or equal.

Number Filter
TODO

Date Filter

Use date filters for columns containing date values. Beyond common filter operators, date filters allow filtering to specific time periods, such as the first quarter of the current year.

Date Filter
TODO

Combined Filter

When you need to filter a column using two conditions, use a combined filter. This lets you create an and/or filter for a given column. The combined filter takes left and right operands for filtering, with an operator that can be either and or or.

Combined Filter
TODO

Function Filter

While the filters above cover most use cases, sometimes you need custom control over filtering behavior. Function filters serve this purpose. Write an arbitrary function predicate that returns true for rows you want to keep (not filter out).

Function Filter
TODO

Managing Filters

The filterModel property serves as the source of truth for simple filters in LyteNyte Grid. Perform common operations by setting values on the grid state.

const model = grid.state.filterModel;
 
// Clear all filters
model.set({});
 
// Delete a specific filter
const columnId = "<id-of-column-to-remove>";
model.set((prev) => {
  const next = { ...prev };
  delete next[columnId];
 
  return next;
});