Data Manager customization: getTopRightButtonsForEditRecord

Data Manager customization: getTopRightButtonsForEditRecord

The getTopRightButtonsForEditRecord customization allows you to completely override the set of buttons that appears at the top right hand side of the edit 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: extraTopRightButtonsForEditRecord.

For example:

// /application/handlers/admin/datamanager/blog.cfc

component {

	private array function getTopRightButtonsForEditRecord( 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.