Data Manager customization: getTopRightButtonsForViewRecord
Data Manager customization: getTopRightButtonsForViewRecord
The getTopRightButtonsForViewRecord
customization allows you to completely override the set of buttons that appears at the top right hand side of the view record listing 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: extraTopRightButtonsForViewRecord.
For example:
// /application/handlers/admin/datamanager/blog.cfc
component {
private array function getTopRightButtonsForViewRecord( event, rc, prc, args={} ) {
var actions = [];
var objectName = args.objectName ?: "";
var recordId = prc.recordId ?: ""
actions.append({
link = event.buildAdminLink( objectName=objectName, operation="reports", recordId=recordId )
, 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.