Actions
The create page (and modal) actions by default include a save button which creates the resource and returns to the show page of the newly created 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: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionSave: <ModelCreateActionSave>Keep Forever</ModelCreateActionSave>}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionSave: <ModelCreateActionSave>Keep Forever</ModelCreateActionSave>}} />
}
}
}
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: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionSave: <ModelCreateActionSave icon="life-preserver" />}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionSave: <ModelCreateActionSave icon="life-preserver" />}} />
}
}
}
Add a cancel action
A cancel action which returns to the index page can be added:
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { hasCancel: true } }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: { 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: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionCancel: <ModelCreateActionCancel>No Way</ModelCreateActionCancel>}} hasCancel />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionCancel: <ModelCreateActionCancel>No Way</ModelCreateActionCancel>}} 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: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionCancel: <ModelCreateActionCancel icon="x-octagon" />}} hasCancel />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: <ModelCreateActionsBase overrides={{ModelCreateActionCancel: <ModelCreateActionCancel icon="x-octagon" />}} hasCancel />
}
}
}
Replace the default actions
You can replace the default actions with custom actions.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: { props: { actions: [<MyCustomAction />]} }
}
}
}
Prepend actions
You can prepend one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}
}
Append actions
You can append one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { append: true, actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: { 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: {
ModelCreateActions: null
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: null
}
}
}
Add a "Save & Add Another" button
And addition "Save & Add Another" button can be added to allow users to create another resource of the same type.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelCreateActions: { props: { append: true, actions: [<ModelCreateActionSaveAnother />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelCreateActions: { props: { append: true, actions: [<ModelCreateActionSaveAnother />]} }
}
}
}