primefaces / primefaces/primereact

DataTable/Column/filterFunction: event is literally 0

Open
#8,479 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Triage
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hello, in our team we have a table where the data for one field are stored outside of row objects. The table is quite big, and this is the only column which is editable so we chose this approach.

<DataTable
  cellMemo={false}
  /* ... */
>
  <Column body={row => getData(row)}/>
  /* ... */
</DataTable>

We'd like to add filtering for the column using filterFunction. According to TypeScript types, the fourth parameter should be ColumnFilterEvent.

// in ColumnProps
filterFunction?(value: any, filter: any, filterLocale: string, params: ColumnFilterEvent): void;

In the ColumnFilterEvent, there should be rowData which we need to access so that we are able to derive the actual value for the column, similarly as we do in the body function.

However, the fourth parameter is literally 0 (zero as a number).

Versions:

  • React 19.2.3
  • PrimeReact 10.9.7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the DataTable/Column filterFunction entry point and inspect the ColumnProps filterFunction type alongside ColumnFilterEvent. Reproduce the example with an external column value, then trace the fourth argument. Done means the callback receives the documented event data, including rowData, rather than the number 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.