primefaces / primefaces/primereact
DataTable/Column/filterFunction: event is literally 0
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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