Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow listActions on a ReferencedList field #269

Closed
Xennis opened this issue Jan 31, 2015 · 3 comments · Fixed by #270
Closed

Allow listActions on a ReferencedList field #269

Xennis opened this issue Jan 31, 2015 · 3 comments · Fixed by #270

Comments

@Xennis
Copy link
Contributor

Xennis commented Jan 31, 2015

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;
                }
@fzaninotto
Copy link
Member

Yes sir, very easy to add.

@Xennis
Copy link
Contributor Author

Xennis commented Jan 31, 2015

Thanks for your always fast support.

(I think my mistake was, that I didn't use the two colons in front of field (in the line list-actions="::field.listActions()".)

@leonardorame
Copy link

Is this already implemented? I pulled the repository today and I noticed the files were updated but this aparently does not work.

Also. Can you post an usage example?.

fzaninotto added a commit that referenced this issue Sep 2, 2015
This ability was lost when the configuration API was refactored to
admin-config.

Refs #269, #270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants