Options for given resource
Usage with TypeScript
import { ResourceOptions } from 'adminjs'
Members
object
|
object
# actions Optional
List of all actions along with their options
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
show |
Partial.<Action.<RecordActionResponse>>
|
<optional> |
|
edit |
Partial.<Action.<RecordActionResponse>>
|
<optional> |
|
delete |
Partial.<Action.<RecordActionResponse>>
|
<optional> |
|
bulkDelete |
Partial.<Action.<BulkActionResponse>>
|
<optional> |
|
new |
Partial.<Action.<RecordActionResponse>>
|
<optional> |
|
list |
Partial.<Action.<ListActionResponse>>
|
<optional> |
|
search |
Partial.<Action.<SearchActionResponse>>
|
<optional> |
|
{...} |
Partial.<Action.<ActionResponse>>
|
HrefFunction
|
string
# href Optional
Where resource link in sidebar should redirect. Default to the list action.
string
# id Optional
Unique id of a resource.
So let's suppose that you connected 2 databases to AdminJS. Both of them have the same collection: 'users'. In this case AdminJS wont be able to distinguish them. In this case changing Id of one of the resources helps to solve this issue.
object
|
string
|
boolean
|
null
# navigation Optional
Navigation option saying under which menu this resource should be nested in sidebar.
Default to the database name.
You have couple of options:
- when you set both navigation.name and navigation.icon this resource will be nested under this menu.
- when you set navigation.name or navigation to a string this resource will be nested under this menu and the icon will come from the database type
- when you set navigation.icon but leave navigation.name as
null
this resource will be top level and it will have an icon. - when you set navigation to null this resource will be top level, but without the icon
- when you set navigation to false this resource will be hidden in the navigation
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string
|
null
|
<optional> |
|
icon |
string
|
<optional> |
object
|
string
|
null
# parent Optional
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string
|
null
|
<optional> |
|
icon |
string
|
<optional> |
- Deprecated:
- in favour of ResourceOptions.navigation
View Source adminjs/src/backend/decorators/resource/resource-options.interface.ts, line 97
object
# sort Optional
Default sort property and direction.
Properties:
Name | Type | Description |
---|---|---|
direction |
'asc'
|
'desc'
|
|
sortBy |
string
|
Type Definitions
object
# HrefContext
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
h |
ViewHelpers
|
view helpers |
|
resource |
BaseResource
|
Resource on which href has been invoked. |
|
currentAdmin |
CurrentAdmin
|
<optional> |
Currently logged in admin |
# HrefFunction(context)
Function returning string or string
Parameters:
Name | Type | Description |
---|---|---|
context |
HrefContext
|