gregnb / mui-datatables

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

CustomFilterListRender not working when ServerSide = true #983

Open danielbyun opened 5 years ago

danielbyun commented 5 years ago

CustomFilterListRender does not work when ServerSide = true

Expected Behavior

After a filter has been applied, the chip should display with the filtered data.

Current Behavior

No chip pops up, with/without customFilterListRender specified.

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Your Environment

Tech Version
Material-UI
MUI-datatables 2.12.0
React 16.9.0
browser chrome
etc
gabrielliwerant commented 5 years ago

Server side filters have been overhauled as they didn't quite work before. The way you specify your rendered filter chips now is with serverSideFilterList. Not having this work alongside customFilterListRender was an oversight. I don't have any timeline, but feel free to jump in with a fix.

patorjk commented 4 years ago

I'm not so sure this is a bug, looking at the code, customFilterListRender does look like it gets applied. However, in the example above, there's no serverSideFilterList option provided. If serverSide is set to true, then the filter list is rendered using the serverSideFilterList. Also, in the example above, the filter dialog has no footer for submitting filters.

I've been thinking about this and I believe the library would be improved if this line https://github.com/gregnb/mui-datatables/blob/master/src/components/TableFilterList.js#L102 was changed to this:

    {(serverSide && serverSideFilterList)

That way the table would continue it's previous behavior if the user wasn't using the serverSideFilterList option.

I have a few more ideas regarding server-side filters, I may put in a PR for them.

giorgiofellipe commented 4 years ago

I can confirm this bug still happens on v2.14.0 (even if I provide serverSideFilterList)