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 list that shows events. By default i want the events that have passed not to show. However i want the user to be able to check a checkbox to show all events so that can see past events if they want.

I can create a filter thats hides past events but i would need this checked by default. how can i do this.

in config_list you can set a default order like so: defaultSort: column: created_at direction: desc

So I'm hoping default filter states can be set in a similar way

thanks

Last updated

JanBo
JanBo

Hi, did you succeeded ? I have the same question. Thanks a lot !

candrabeqx
candrabeqx

I know this was a very old question, but someone (like me) might got this discussion from search engine. Default filter can be achieved by overriding listExtendQuery method inside the controller class.

this just a rough example:

public function listExtendQuery($query)
{
    $query->where('key', 1); // you can add whatever filter you need here
}

reference

Last updated

1-3 of 3

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