Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomFilterListRender not working when ServerSide = true #983

Open
danielbyun opened this issue Oct 4, 2019 · 3 comments
Open

CustomFilterListRender not working when ServerSide = true #983

danielbyun opened this issue Oct 4, 2019 · 3 comments
Labels

Comments

@danielbyun
Copy link
Contributor

danielbyun commented Oct 4, 2019

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)

Your Environment

Tech Version
Material-UI
MUI-datatables 2.12.0
React 16.9.0
browser chrome
etc
@gabrielliwerant
Copy link
Collaborator

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
Copy link
Collaborator

patorjk commented Dec 1, 2019

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
Copy link

giorgiofellipe commented Feb 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants