Adding search and pagination to relationships modal

Hello, I’m having some trouble finding out how to implement search and pagination to the modal view when adding a relationship. For Some context I have a form to create a travel guide, and I want to attach some related cities to that travel guide.

At the bottom of the form I have the relationship to add the cities.

When I click on “Add City” the modal view pops up.

Is it possible to add search and pagination to modal records? I’m hoping it’s just a setting in a yaml file I missed.

Here is my config_relation.yaml file if that helps.

# ===================================
#  Relation Behavior Config
# ===================================

cities:
    label: City
    view:
        list: $/redacted/destinations/models/city/columns.yaml
        showSearch: true
        showSorting: true
        toolbarButtons: add|remove
        recordsPerPage: 10

Thanks.

question is, if controller for that implements

Backend.Behaviors.RelationController

and then, if is specified a config to load for relation like

public $relationConfig = 'config_relation.yaml'; 

more about relation controller you can find here

You could put a type switch to your ‘Is Active’ column… that would improve the visual a little bit.

enabled:
    label: Enabled
    type: switch

Yeah the relationship is fine. It’s more when the view to add the relation pops up, its a list of thousands of records - which isn’t very usable. I’m trying to find out if it’s possible to add a search box and pagination to the modal.

All fixed, the answer was in the docs. I needed to add a manage key to the config_relation.yaml.

# ===================================
#  Relation Behavior Config
# ===================================

cities:
    label: City
    view:
        list: $/itmdevlabs/destinations/models/city/columns.yaml
        showSearch: true
        showSorting: true
        toolbarButtons: add|remove
        recordsPerPage: 10
    manage:
        form: $/itmdevlabs/destinations/models/city/fields.yaml
        showSearch: true
        recordsPerPage: 10
1 Like