gp-grid-logo
Examples

Filtering

Add column filtering to the Vue 3 grid using built-in operators, custom filter components, and live updates as users refine their search criteria today.

gp-grid provides powerful column filtering.

Basic Filtering

Click the filter icon in a column header to open the filter popup:

<script setup lang="ts">
const columns: ColumnDefinition[] = [
  {
    field: "name",
    cellDataType: "text",
    width: 150,
    filterable: true,
  },
  {
    field: "salary",
    cellDataType: "number",
    width: 120,
    filterable: true,
  },
];
</script>

Filter Operators

Text Filters

OperatorDescription
containsValue contains text
notContainsValue does not contain text
equalsExact match
notEqualsNot an exact match
startsWithValue starts with text
endsWithValue ends with text
blankValue is empty
notBlankValue is not empty

Number Filters

OperatorDescription
=Equal to
!=Not equal to
>Greater than
<Less than
>=Greater than or equal
<=Less than or equal
betweenWithin range

Values Mode

Text filter popups also offer a checkbox list of the column's distinct values. Entries are grouped by display label: with a valueFormatter, several raw values can share one label, and ticking it selects all of them. The applied filter always stores the raw values (selectedValues: Set<CellValue>), so a formatter never changes what a server data source receives.

When the column contains blank cells — null, empty strings, or empty arrays such as a tags column with no tags — the list shows a (Blanks) entry. Untick it to exclude blank rows from the result.

Disable Filtering

<script setup lang="ts">
const columns: ColumnDefinition[] = [
  { field: "id", cellDataType: "number", width: 80, filterable: false },
  { field: "name", cellDataType: "text", width: 150 },  // filterable by default
];
</script>