Closed mrded closed 7 years ago
You can do such a custom button by inserting a directive like:
entity.showView()
.actions(['list', 'delete', '<custom-directive></custom-directive>']);
You just have to add you directive to the angular app:
app.directive('customDirective', require('./path/to/directive'));
If you have some issue to implement a custom list action, you can ask on StackOverflow with the tag ng-admin
.
@Kmaschta thank you for your reply, it was quick :)
I've updated my issue. There is no problem with adding a custom directive on listView
you're right. It's in the doc.
The problem is with showView
. These action buttons are hardcoded in the template, look here.
Yup, sorry I wrote a little fast.
Look at this Plunkr: http://plnkr.co/edit/YbWetcmzBQ4qaI3qFuK3?p=preview, go to User List > Show a user
You can do a custom action in the showView.
Thanks a lot! :)
Hi there,
It will be great if it's possible to add custom actions, next to existing
ma-view-actions
onshowView
view.Use case
We have several ways to delete users. By default users can delete them self by sending
DELETE /user/{id}
. However, we also have possibility to ban spammers by sendingDELETE /user/{id}?spam=true
. Currently there is no way, I can ban spammers.It's just one example, but you may also have several end points which you want to trigger from
showView
.As I see, currently these buttons are hardcoded.