This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

phplee
phplee

I have a payment plugin. i have a filter that when checked it 'Shows only complete' payments. Is there a way to make the filter active by default to only complete patent show and the user would have to uncheck 'Shows only complete' to everything else.

thanks

phplee
phplee

Can anyone help me on this.

I just want my chackedbox list filter to be checked by default

Bhargav
Bhargav

Did you find way to do this?

phplee
phplee

hi pal,

afraid not. however you can make the filter apply by default. just not the widget. i.e checkbox. this link has an example of how to filter list when it loads.

https://octobercms.com/forum/post/how-to-filter-a-list-controller

tristanbailey
tristanbailey

If you look in the docs for Backend Lists, the config_filter.yaml file you can add a default https://octobercms.com/docs/backend/lists#list-filters

There are different defaults for different types, but this is the checkbox one I am testing. Just can't tell if it is cached in the session or something, as after unchecked, and visit the page again it is not checked. Should work though.

scopes:

    payment:
        label: Shows only complete
        type: checkbox
        default: 1
        conditions: is_complete <> true

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.