Data Manager customization: getTopRightButtonsForAddRecord
Data Manager customization: getTopRightButtonsForAddRecord
The getTopRightButtonsForAddRecord customization allows you to completely override the set of buttons that appears at the top right hand side of the add record screen. It must return an array of structs that describe the buttons to display and is provided the objectName in the args struct.
Note, if you simply want to add, or tweak, the top right buttons, you may wish to use Data Manager customization: extraTopRightButtonsForAddRecord.
For example:
// /application/handlers/admin/datamanager/blog.cfc
component {
private array function getTopRightButtonsForAddRecord( event, rc, prc, args={} ) {
var actions = [];
var objectName = args.objectName ?: "";
actions.append({
link = event.buildAdminLink( objectName=objectName, operation="reports" )
, btnClass = "btn-default"
, iconClass = "fa-bar-chart"
, globalKey = "r"
, title = translateResource( "preside-objects.blog:reports.btn" )
} );
return actions;
}
}
Info
See Reference: Data Manager top right buttons array for detailed documentation on the format of the action items.