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

Zarkweb
Zarkweb

Hi, I'm currently developing a backend application and I need to apply filters to a relation manager.

Here is what I have done so far: I have a list of dashboards which is filtrable: filtrable list

In another backend option, I have a relation manager based on the same model to display data: not filtrable list

I have read over all the documentations and google results but found no way of making the relation manager popup filterable. Is there a hidden way ? With events, config / hacking the core sources of October ? This feature is really important for our project, hope someone can help me ! =)

Sebastiaan Kloos (ICTBelang)
Sebastiaan Kloos (ICTBelang)

I would like to do this also.

andreabersi22034
andreabersi22034

I also need this feature... any news? I have googled but no result

netsmertia
netsmertia

This is from one of my project. You need to define a filter for your relation in config_relation.yaml

related:
    label: Related Recipes
    view:
        list: $/recipe/recipe/models/recipe/columns.yaml
        toolbarButtons: add|remove
    manage:
        list: $/recipe/recipe/models/recipe/columns_related.yaml
        form: $/recipe/recipe/models/recipe/fields.yaml
        recordsPerPage: 10
        showSearch: true
        filter: config_filter.yaml <-- Add this

Filters


scopes:
    published:
      label: Published
      type: checkbox
      default: 0
      conditions: is_published = true
    unpublished:
      label: Unpublished
      type: checkbox
      default: 0
      conditions: is_published <> true
    category:
        label: Category
        modelClass: Recipe\Recipe\Models\Category
        conditions: id in (:filtered)
        nameFrom: category_title
    recipe_type:
      label: Recipe Type
      type: group
      conditions: recipe_type = (:filtered)
      options:
        TEXT: Recipe Post
        VIDEO: Recipe Video
        BOTH: Recipe Post with Video
oskar.villani40843
oskar.villani40843

Hello Zarkweb, have a look at the OctoberCMs tutorials made by Ivan Doric (watch+learn) on youtube. This one (nr. 35) covers backend filters: https://www.youtube.com/watch?v=lriYOZF2OF4&list=PLUBR53Dw-Ef-X-_A1KLy41r2QArCBy4rM&index=35 Nr, 34 covers backend lists in general.

Regards

1-5 of 5

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