Datatable clear all filters

UI Components for React
Post Reply
JBottomley
Posts: 17
Joined: 31 Aug 2018, 12:55

26 Nov 2019, 13:35

Hi,

I have a datatable where I have applied multiple filters. Is there an easy way of clearing all of the filters, resetting the datatable in the process?

Cheers

shmbar
Posts: 6
Joined: 08 Jan 2019, 15:00

01 Jan 2020, 15:41

HI

I'm struggling with the same issue.
Did you find a way to solve it out?

sdtacoma
Posts: 1
Joined: 17 Mar 2021, 21:29

17 Mar 2021, 21:33

This is what I have gotten to work, sorta. It resets the table but not the fields for the filters. I can't figure out how to get the filter fields to clear too.

I am hoping somebody else can chime in and help.

Code: Select all

	const resetFilters = () => {
		dt.current.reset()
	}
	<button label="Clear Filters" onClick={resetFilters}>Clear Filters</button>

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

06 May 2021, 22:36

Hi,

Sorry for the delayed response! I'll add a new demo related to the clear filter field. Thanks a lot for your feedbacks!

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests