Adds new form actions and buttons to GridField detail form for usability enhancements.
Modifies the detail form of GridFields to use more user-friendly actions, including:
SilverStripe 3.0 or higher
Preferences for which buttons should appear where will vary from user to user. BetterButtons comes with a default set of button collections for the "create" and "edit" views in a GridField detail form, but these can be easily overridden in a config.yml file.
The default configuration: ``` BetterButtonsViews: create: ButtonSave: true ButtonSaveAndAdd: true ButtonSaveAndClose: true ButtonCancel: true edit: ButtonSave: true GroupSaveAnd: true ButtonCancel: true ButtonDelete: true
BetterButtonsGroups: SaveAnd: label: Save and... buttons: ButtonSaveAndAdd: true ButtonSaveAndClose: true ButtonSaveAndNext: true ButtonSaveAndPrev: true
Each button type is assigned a symbol in the YAML definition. It can be placed anywhere any number of times. Further, it can be placed in a named group, provided that group has been defined in the BetterButtonsGroups node. A button group is a single button with a label that exposes a series of options on click.
Because of the idiosyncracies of the Config layer merging arrays, the buttons must be defined as on or off (true or false). To remove a button from the default configuration, you must explicitly set it to false in your project configuration. Here is an example custom configuration.
``` BetterButtonsViews: edit: ButtonSave: false GroupSaveAnd: false GroupMyGroup: true BetterButtonsGroups: MyGroup: label: This is a group buttons: ButtonSave: true Button_SaveAndNext: true
When creating groups, be sure not to duplicate any buttons that are outside the group, as form fields with the same name cannot appear twice in a form.
Integrate with versioned dataobjects.