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

feat: Add manual filters #146

Merged
merged 6 commits into from
Jan 29, 2020
Merged

feat: Add manual filters #146

merged 6 commits into from
Jan 29, 2020

Conversation

mikemurray
Copy link
Member

Resolves #145
Impact: minor
Type: feature

Issue

Filters can only be applied to columns, and are thereby limited in the number of filters you can set on a table based on the number of columns.

Solution

Add manual filters options to the useDataTable hook. Any number of filters may be set, which then triggers onFetchData. As the name suggests, the manual filters are manual. No automatic filtering will happen, it's up to your onFetchData function to handle the filtering.

You can access them from the return value like so.

const { setManualFilters, setAllManualFilters, state: { manualFilters } = useDataTable(...)

Breaking changes

none

Testing

  1. Test the DataTable in the docs and see that manual filters work. There's a button named Set manual filters at the bottom of the table

@netlify
Copy link

netlify bot commented Jan 29, 2020

Deploy preview for heuristic-perlman-0ef024 ready!

Built with commit a41d6ea

https://deploy-preview-146--heuristic-perlman-0ef024.netlify.com

Copy link
Member

@willopez willopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@willopez willopez merged commit f220a04 into trunk Jan 29, 2020
@willopez willopez deleted the feat-145-mikemurray-array-filters branch January 29, 2020 17:44
@rc-publisher
Copy link
Collaborator

🎉 This PR is included in version 1.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rc-publisher rc-publisher added the released Applied automatically by semantic-release label Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Applied automatically by semantic-release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataTable: add hook for filtering by list of ids
3 participants