DataTable/Column/filterFunction: event is literally 0

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

Nobody has claimed this yet.

Assessment

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

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.

Description

Status: Needs Triage

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
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from primefaces/primereact

All issues in primefaces/primereact

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.