Skip to content
Data TableAPI Reference

Filter options and change events

comins-table@0.2.2React

columnFiltering filters a parent-owned array on the client. Its presence disables row drag even with an empty model. Connect both controlled values and callbacks for the filter button and editor.

kind Supported operators
text contains, notContains, startsWith, endsWith, equals, notEquals, isEmpty, isNotEmpty
number / date equals, notEquals, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual, between, isEmpty, isNotEmpty
boolean equals, notEquals, isEmpty, isNotEmpty

Dates use UTC calendar days. Invalid dates, values, and operator rules are ignored; no valid rules means all rows are shown. For text, whitespace is a value; only null/undefined/empty strings are empty. Filtering does not reorder source data. Hidden selected row IDs are retained, while cell/range selections that depend on visible coordinates may be cleared.

Filtering example

model: CominsColumnFilterModel;

Required complete rule array. Empty means no filters. Different columns combine with AND; only the first valid rule per column applies.

onChangeModel?: (model: CominsColumnFilterRule[]) => void;

Receives the full next model after editing/removal. The editor is read-only without it.

openColumnId?: string | null;

Currently open column ID or null. No filter is open when omitted.

onChangeOpenColumnId?: (columnId: string | null) => void;

Receives the next ID or null when opening/closing. The header filter button is disabled without it. Apply the result to openColumnId.

kind: CominsColumnFilterKind;

Required value kind: text, number, date, or boolean.

caseSensitive?: boolean;

Defaults to false for text. true makes comparisons case-sensitive.

getValue?: (params: CominsCellFormatParams<TData, TValue>) => unknown;

Defaults to the raw field value. Provide a resolver to customize the filter value only.

columnId: string;

Required ID of a filter-enabled column. Unknown-column rules are ignored.

operator: CominsColumnConditionFilterOperator;

Required supported operator for the kind below. Invalid combinations are ignored.

value?: CominsColumnFilterValue;

Comparison value; omit for isEmpty/isNotEmpty. Use finite numbers, YYYY-MM-DD date strings, or booleans for the corresponding kinds.

valueTo?: null | number | string;

Other endpoint for between. Both endpoints are inclusive and reversed bounds are normalized.

getOptionLabel?: (value: CominsColumnFilterValue) => string;

See the value-list filtering guide for rendering precedence and return values.

mode?: "condition" | "values";

See the value-list filtering guide for rendering precedence and return values.

trigger?: CominsValueFilterPart<CominsValueFilterTriggerRenderParams<TData>>;

See the value-list filtering guide for rendering precedence and return values.

option?: CominsValueFilterPart<CominsValueFilterOptionRenderParams<TData>>;

See the value-list filtering guide for rendering precedence and return values.

panel?: CominsValueFilterPart<CominsValueFilterPanelRenderParams<TData>>;

See the value-list filtering guide for rendering precedence and return values.

values?: never;

See the value-list filtering guide for rendering precedence and return values.

export type CominsColumnFilterRule = CominsColumnConditionFilterRule | CominsColumnValueFilterRule;