ColumnFilterController

Handle given to a column's DataTableHeader.filterContent, for filters that are not a plain text field.

A custom filter renders whatever control it likes — a dropdown of the values that occur, a range of dates, a tri-state flag — and calls setQuery with the text that stands for the user's choice. That text is what the table stores in its filters map, hands back here on the next composition, and passes to the column's DataTableHeader.filterPredicate, so a filter whose state does not naturally read as one string encodes it into one — ">1000", or "IT|Finance" — and its own predicate decodes it again.

Keeping the value a String is what lets the whole filter set be lifted out of the table, saved with a user's layout, or turned into a WHERE clause.

Properties

Link copied to clipboard

DataTableHeader.key of the column being filtered.

Link copied to clipboard

The query text currently set for that column, empty when it is not filtered.

Functions

Link copied to clipboard
fun clear()

Clears the column's filter, which is setQuery with an empty string.

Link copied to clipboard
fun setQuery(query: String)

Sets the column's query, filtering the table.