Skip to content

Server-side filtering (filterServer prop) and interop with server pagination/sorting #1365

Description

@jbetancur

Summary

Add server-side column filtering via a filterServer prop, mirroring the existing sortServer / paginationServer opt-outs.

Motivation

Filtering is currently always client-side. It works alongside sortServer (filter runs on the server-sorted rows), but breaks with paginationServer: the client only holds the current page, so a filter can only ever match rows on that page. There is no way to filter a server-paginated dataset correctly today. See #1364 for the client-side ordering fix and the analysis of the server interaction.

Proposed change

  • New filterServer?: boolean prop (default false).
  • When true, the library skips client-side filtering entirely — filteredData becomes a pass-through — and relies on the consumer to refetch data in response to onFilterChange, the same contract as sortServer + onSort and paginationServer + onChangePage.
  • onFilterChange already fires with (columnId, FilterState), so the callback surface exists; this is mostly about not double-filtering on the client.

Interop notes

  • filterServer + paginationServer: the intended combination. Consumer sends filter + page + sort to the server and gets back the current page; library renders it as-is. paginationTotalRows drives the pagination count.
  • filterServer + sortServer: consumer applies filter and sort server-side together.
  • filterServer without server pagination: valid but unusual — consumer filters server-side and returns the full filtered set for client pagination.

Docs

Document the three server modes together (sort / paginate / filter) and how they compose, since the refetch contract is shared.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions