Skip to content

Allow listActions on a ReferencedList field #269

@Xennis

Description

@Xennis

I think, it would be nice to have the possibility to use the listActions option from the listView also on a ReferencedList field. Hence it would be possible to jump form the ReferencedList table to the edtion, show and/or delete view of the corresponding item.

Since the directive <ma-datagrid> is used for the ReferencedList too, this shouldn't be a big change in the existing code. I wasn't able to do it, probably because of a lack of knowledge about Angular binding and compiling issues.

In maColumn.js from line 20 on: Instead of parsing an empty array for listActions you would parse then the new added variable listActions from the ReferencedList instance.

                if (scope.type == 'ReferencedList') {
                    // special case to avoid recursion
                    element.append(
                        '<ma-datagrid name="{{ field.getReferencedView().name() }}"' +
                             'entries="field.entries"' +
                             'fields="field.getReferencedView().fields()"' +
                             'entity="field.getReferencedView().entity"' +
                             'listActions="[]">' +
                        '</ma-datagrid>'
                    );
                    $compile(element.contents())(scope);
                    return;
                }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions