Skip to content

v1.5.5

Choose a tag to compare

@windischb windischb released this 09 Apr 05:27
· 284 commits to develop since this release

Added

  • Custom data filter: New builder.customFilter((data, searchText) => filteredData | null) method on CoarGridBuilder. Filters the entire data array before passing it to AG Grid, replacing the per-row quick filter. This enables filter logic that depends on related rows — e.g. keeping all siblings in a tree when any one matches the search. Returning null from the callback falls back to the default quick filter for that evaluation, allowing dynamic switching between custom and standard filtering.

  • Pipeline update triggers: New builder.updateOn(...sources) method. Re-runs the data pipeline (filtering, tree flattening) when the given reactive sources change. Works with all pipeline modes (tree, flat+search, flat reactive) — useful when customFilter or quickFilterFn depends on external state like toggle flags.

Example

const showSubTodos = ref(false)

builder
  .treeData({ children: row => row.children, rowId: row => row.Id })
  .customFilter((todos, search) => {
    // null → fall back to default quickFilter (per-row matching)
    if (!showSubTodos.value) return null

    if (!search.trim()) return todos
    const q = search.toLowerCase()

    // Keep entire group when any member matches
    return todos.filter(parent =>
      matches(parent, q) ||
      parent.children.some(child => matches(child, q))
    )
  })
  .updateOn(showSubTodos)
customFilter return Behavior
TData[] Custom filter takes over, quickFilter is bypassed
null Falls back to the default quickFilter (per-row matching)