-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Create a 'Reset filters' button #816
Comments
Duplicate of #817 |
@fzaninotto I won't consider it as a duplicate. Indeed the two issues are related with a common objective at first (the between filter). However, the features are different and this one can be used to clean all the filters with 1 click. |
OK, it's not a duplicate. But I don't want to implement this in the core - it will clutter the interface even more, unless a UX master shows me the contrary. You should be able to do that via a custom |
Here's how I created a "Clear Filters" button ( Extending upon the custom import { FilterList } from "@material-ui/icons";
import React from "react";
import {
Button,
sanitizeListRestProps,
TopToolbar
} from "react-admin";
const ListActionsTopToolbar = (props) => {
const {
className,
exporter,
filters,
maxResults,
setFilters,
...rest
} = props;
return (
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
{/* Clear Filters Button */}
<Button onClick={() => setFilters({})} label="Clear Filters">
<FilterList />
</Button>
</TopToolbar>
);
}; StackOverflow: https://stackoverflow.com/a/65015214/782034 |
I don't understand not implementing an obvious feature just because it would clutter up the interface. It could easily be put into an overflow menu. |
Well, here's what I suggest: open a pull request implementing this button, with tests and screencasts/screenshots of the results. In the event we end up choosing to not include it, you will then be able to keep the code and open source it as an addon package. |
Thank you for your suggestion. Here's what I suggest: Listen to your users and appreciate the feedback that they've taken the time to give to you. |
i think this finally lands in 4.3 with #8017 |
Came here looking for others on same path. Happy to hear this finally made the cut, feature wise. Tricky UIX wise... but, as they say, where there is a will, there is a way ;) |
Hello,
I have an issue with filters on the list page.
I'm using DateInput fields to create a "between" like filter. To manage display both input fields (From and To), I had to use the alwaysOn property.
However, I cannot empty the DateInput to reset the filters and display all my models.
A button reset filters would solve this by resetting the current chosen filters.
Thanks for your help.
The text was updated successfully, but these errors were encountered: