Actions
The edit page (and modal) actions by default include a save button which saves the resource and returns to the show page of the resource.
Change the text of the save button
The text of the save button can be changed by passing in a child component.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionSave: <ModelEditActionSave>Keep Forever</ModelEditActionSave>}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionSave: <ModelEditActionSave>Keep Forever</ModelEditActionSave>}} />
}
}
}
Change the icon of the save button
The icon of the save button can be changed by passing in an icon name.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionSave: <ModelEditActionSave icon="life-preserver" />}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionSave: <ModelEditActionSave icon="life-preserver" />}} />
}
}
}
Add a cancel action
A cancel action which returns to the show page can be added:
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelEditActions: { props: { hasCancel: true } }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: { props: { hasCancel: true } }
}
}
}
Change the text of the cancel button
The text of the cancel button can be changed by passing in a child component.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionCancel: <ModelEditActionCancel>No Way</ModelEditActionCancel>}} hasCancel />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionCancel: <ModelEditActionCancel>No Way</ModelEditActionCancel>}} hasCancel />
}
}
}
Change the icon of the cancel button
The icon of the cancel button can be changed by passing in an icon name.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionCancel: <ModelEditActionCancel icon="x-octagon" />}} hasCancel />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: <ModelEditActionsBase overrides={{ModelEditActionCancel: <ModelEditActionCancel icon="x-octagon" />}} hasCancel />
}
}
}
Replace the default actions
You can replace the default actions with custom actions.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelEditActions: { props: { actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: { props: { actions: [<MyCustomAction />]} }
}
}
}
Prepend actions
You can prepend one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelEditActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}
}
Append actions
You can append one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelEditActions: { props: { append: true, actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: { 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: {
ModelEditActions: null
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelEditActions: null
}
}
}