Creating a dataTable that starts off with one of it's columns in a filtered state

UI Components for React
Post Reply
platty__
Posts: 1
Joined: 31 May 2023, 00:26

31 May 2023, 00:37

Hi there!

I'm working on a project where we are using prime react to display a bunch of data using the DataTable component.
We want the table to be initialized on page load with one of the columns filters being activated(the filter is a simple checkbox to filter for active rows,
vs showing both rows that are active and inactive when the checkbox is unclicked. We want to start off by only showing rows in the 'active' state,
with the checkbox clicked to begin with.)

So far we haven't been able to successfully implement this. Does anybody have any experience doing something like this with prime react?

Thanks in advance!

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

02 Jun 2023, 23:51

Yep see my Reproducer: https://stackblitz.com/edit/react-bneau ... c%2FApp.js

It starts with the Name field filtered for "James" only.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest