Actions
The index page actions by default is simply the create action which transfers to the create pagek. You can add alter actions on the index page by manipulating the ModelIndexActions
component.
Change the text of the create button
The text of the create button can be changed by passing in a child component.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelIndexActionCreate: (<ModelIndexActionCreate>New Blog</ModelIndexActionCreate>)}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelIndexActionCreate: (<ModelIndexActionCreate>New Blog</ModelIndexActionCreate>)}} />
}
}
}
Change the icon of the create button
The icon of the create button can be changed by passing in an icon name.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelIndexActionCreate: (<ModelIndexActionCreate icon="plus-circle"/>)}} />
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: <ModelIndexActionsBase overrides={{ ModelIndexActionCreate: (<ModelIndexActionCreate icon="plus-circle"/>)}} />
}
}
}
Replace the default action
You can replace the default action with custom actions.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: { props: { actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: { props: { actions: [<MyCustomAction />]} }
}
}
}
Prepend actions
You can prepend one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: { props: { prepend: true, actions: [<MyCustomAction />]} }
}
}
}
Append actions
You can append one or more actions to the defaults.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: { props: { append: true, actions: [<MyCustomAction />]} }
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: { 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: {
ModelIndexActions: null
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: null
}
}
}
Create with a modal
Instead of creating on a separate page, you can create with a modal.
- Global
- Model
const rhinoConfig = {
version: 1,
components: {
ModelIndexActions: ModelIndexActionsModalCreate
}
}
const rhinoConfig = {
version: 1,
components: {
blog: {
ModelIndexActions: ModelIndexActionsModalCreate
}
}
}