AdminForthResourceCommon
Resource describes one table or collection in database. AdminForth generates set of pages for 'list', 'show', 'edit', 'create', 'filter' operations for each resource.
Extends
Properties
columns
columns:
AdminForthResourceColumnCommon
[]
Array of columns which will be displayed in the admin panel. Each column has its own configuration.
Overrides
AdminForthResourceInputCommon
. columns
dataSource
dataSource:
string
ID of datasource which will be used to fetch data from.
Inherited from
AdminForthResourceInputCommon
. dataSource
label
label:
string
Label for resource which will be displayed in the admin panel. By default it equals to table name in database.
Overrides
AdminForthResourceInputCommon
. label
options?
optional
options:object
General options for resource.
allowedActions?
optional
allowedActions:AllowedActionsResolved
Allowed actions for resource.
Example:
allowedActions: {
create: ({ resource, adminUser }) => {
// Allow only superadmin to create records
return adminUser.dbUser.role === 'superadmin';
},
delete: false, // disable delete action for all users
}
bulkActions?
optional
bulkActions:AdminForthBulkActionCommon
[]
Custom bulk actions list. Bulk actions available in list view when user selects multiple records by using checkboxes.