Filter on displayed values from global filter in DataTable

UI Components for React
Post Reply
njain
Posts: 6
Joined: 01 Nov 2016, 09:05

26 Nov 2020, 16:40

Hello,

I have implemented a template for a column to display name of the month, rather than its numeric value say 1 or 5. To reiterate, the template returns 'January' for column value 1. On top of this I have enabled global filter.

<Column field="month" header="Month" body={this.monthTemplate} sortable />

The issue is that if I type 'January' in global filter, as expected no records are filtered; however, when I type 1, record that displays 'January' in month column is filtered.

If I replace the field value with a function that returns a value (January) for the key (1), it works with an expected warning "Failed prop type: Invalid prop `field` of type `function` supplied to `Column`, expected `string`.".

<Column field={monthFilter} header="Month" body={this.monthTemplate} sortable />

Please advise if there is a solution to the above problem.

Best Regards
Nitin

mert.sincan
Posts: 4579
Joined: 29 Jun 2013, 12:38

12 Dec 2020, 03:36

Hi,

I think we can add globalFilterFunction property for this. Could you please create a github issue?

Best Regards,

pathonix12
Posts: 1
Joined: 22 Dec 2020, 11:11

22 Dec 2020, 11:16

The example above shows the Analysis Filter in use with a data table. ... The Analysis Filter is usually used to compare column data and a value you enter, but you can also directly ... The Global Filter panel will be displayed, as shown above. https://myhr.onl/myhr-savers/

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest