Dynamic default backend list filter #356
-
When creating a dynamic list of group filter options, we can use a method name in the modelClass model. But I did not found a way how to set a default filter dynamically. Example: I have only one status table for all my models Model Status
To create a filter group for my quotations I can create a function
and reference the function in my config_filter.yaml scope options
works fine. But now I would like to set the initial filter (filter active when a user opens the list view) for active quotations only. I created a similar method
and I tried to add the reference to the function in my filter definition
and this does not work, it looks like the defaults must be hardcoded. Any idea? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@envas You can use the The Filter Dependencies section in the Docs details this some more, and should hopefully lead you on the right path. |
Beta Was this translation helpful? Give feedback.
@envas You can use the
options
callback for both cases. I assume that you are using another scope that will change the options available in this particular filter, so what you can do is make thisstatus
scope depend on another scope, and use it's value to determine whether you need to change the query for the available options.The Filter Dependencies section in the Docs details this some more, and should hopefully lead you on the right path.