Filter Button color

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
kdroder
Posts: 4
Joined: 2023-03-30 20:46

Filter Button color

Post by kdroder » 2023-04-26 09:32

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.

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: Filter Button color

Post by a.gneady » 2023-04-28 12:46

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>
:idea: AppGini plugins to add more power to your apps:


kdroder
Posts: 4
Joined: 2023-03-30 20:46

Re: Filter Button color

Post by kdroder » 2023-05-08 10:42

Hi Ahmed,

absolutely perfect.

Thank you very much

Klaus

Post Reply