Page 1 of 1

Filter Button color

Posted: 2023-04-26 09:32
by kdroder
I'm wondering if there is a simple way to colorize the FILTER button whenever a filter is set (and to reset it after filters are rested). This would help users understand why an entry in the quick search field doesn't offer the expected records.

Thanks for your suggestions.

Re: Filter Button color

Posted: 2023-04-28 12:46
by a.gneady
That's a really good suggestion for a helpful UX enhancement. You can add the following code to hooks/footer-extras.php:

Code: Select all

<script>$j(() => {
    const filtersApplied = $j('[name^=FilterField]').length > 0;
    $j('#Filter.btn')
        .toggleClass('btn-warning',  filtersApplied)
        .toggleClass('btn-default', !filtersApplied)
})</script>

Re: Filter Button color

Posted: 2023-05-05 14:49
by onoehring
Hi Ahmed,

thanks for the code. Really a nice addition.
Olaf

Re: Filter Button color

Posted: 2023-05-08 10:42
by kdroder
Hi Ahmed,

absolutely perfect.

Thank you very much

Klaus