Actions
The show page actions by default include an edit button which transfers to the edit page and a delete button which prompts the user to delete. You can add alter actions on the index page by manipulating the ModelShowActions
component.
Change the text of the edit button
The text of the edit button can be changed by passing in a child component.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelShowActions: <ModelShowActionsBase overrides={{ ModelShowActionEdit: (<ModelShowActionEdit>Change Blog</ModelShowActionEdit>)}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelShowActions: <ModelShowActionsBase overrides={{ ModelShowActionEdit: (<ModelShowActionEdit>Change Blog</ModelShowActionEdit>)}} />
}
}
}
Change the icon of the edit button
The icon of the edit button can be changed by passing in an icon name.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelShowActionEdit: <ModelShowActionEdit icon="pen"/>}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelShowActionEdit: <ModelShowActionEdit icon="pen"/>}} />
}
}
}
Change the text of the delete button
The text of the delete button can be changed by passing in a child component.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelShowActions: <ModelShowActionsBase overrides={{ ModelShowActionDelete: (<ModelShowActionDelete>Throw Away Blog</ModelShowActionDelete>)}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelShowActions: <ModelShowActionsBase overrides={{ ModelShowActionDelete: (<ModelShowActionDelete>Throw Away Blog</ModelShowActionDelete>)}} />
}
}
}
Change the icon of the delete button
The icon of the delete button can be changed by passing in an icon name.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelShowActionDelete: <ModelShowActionDelete icon="trash2" />}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelShowActionDelete: <ModelShowActionDelete icon="trash2" />}} />
}
}
}
Remove the edit button
The edit button can be removed entirely
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelShowActionEdit: null}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelShowActionEdit: null}} />
}
}
}
Remove the delete button
The delete button can be removed entirely
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelShowActionDelete: null}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelShowActionDelete: null}} />
}
}
}
Replace the default actions
You can replace the default actions with custom actions.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelShowActions: { props: { actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelShowActions: { props: { actions: [<MyCustomAction />]} }
}
}
}
Prepend actions
You can prepend one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelShowActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelShowActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}
}
Append actions
You can append one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelShowActions: { props: { append: true, actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelShowActions: { props: { append: true, actions: [<MyCustomAction />]} }
}
}
}
Remove all actions
You can append one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelShowActions: null
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelShowActions: null
}
}
}
Edit with a modal
Instead of editing on a separate page, you can edit with a modal.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelShowActions: ModelShowActionsModalEdit
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelShowActions: ModelShowActionsModalEdit
}
}
}