gregnb / mui-datatables

Datatables for React using Material-UI
MIT License
2.71k stars 935 forks source link

Question on filtered data #1727

Open bharath-9 opened 3 years ago

bharath-9 commented 3 years ago

@gregnb Help required Hi, I have been playing around this library and has been great so far. I am having an issue accessing the filtered data. Is there some variable already or how can I proceed with that. I want to perform few actions on the filtered data outside the toolbar...Is it possible somehow?

Please Help. It's kinda Urgent to me!!

vivekkumarbilla commented 3 years ago

Hope this is not too late,

Mui Datatable is for client side only it has nothing to do with server, so when we filter items, the non qualified items are just hidden.

But you can access that data with the onFilterChange method: onFilterChange: (changedColumn, filterList, type, changedColumnIndex, displayData) => { setFilteredData(displayData) } displayData prop gives the data that is visible, I have just used hooks to store the filtered data whenever new filters are added or removed.