Skip to main content

Interface: EntityCollection<M, AdditionalKey, UserType>

This interface represents a view that includes a collection of entities. It can be in the root level of the configuration, defining the main menu navigation. You can also find it as a subcollection of a different one.

Type parameters

NameType
Mextends Object = any
AdditionalKeyextends string = string
UserTypeUser

Properties

additionalColumns

โ€ข Optional additionalColumns: AdditionalColumnDelegate<M, AdditionalKey, UserType>[]

You can add additional columns to the collection view by implementing an additional column delegate.q

Defined in

models/collections.ts:78


callbacks

โ€ข Optional callbacks: EntityCallbacks<M>

This interface defines all the callbacks that can be used when an entity is being created, updated or deleted. Useful for adding your own logic or blocking the execution of the operation.

Defined in

models/collections.ts:133


defaultSize

โ€ข Optional defaultSize: CollectionSize

Default size of the rendered collection

Defined in

models/collections.ts:57


description

โ€ข Optional description: string

Optional description of this view. You can use Markdown.

Defined in

models/collections.ts:27


excludedProperties

โ€ข Optional excludedProperties: (AdditionalKey | Extract<keyof M, string>)[]

Properties that should NOT get displayed in the collection view. All the other properties from the the entity are displayed It has no effect if the properties value is set.

Defined in

models/collections.ts:52


exportable

โ€ข Optional exportable: boolean | ExportConfig<UserType>

Should the data in this collection view include an export button. You can also set an ExportConfig configuration object to customize the export and add additional values. Defaults to true

Defined in

models/collections.ts:119


filterCombinations

โ€ข Optional filterCombinations: Partial<Record<Extract<keyof M, string>, "asc" | "desc">>[]

If you need to filter/sort by multiple properties in this collection, you can define the supported filter combinations here. In the case of Firestore, you need to create special indexes in the console to support filtering/sorting by more than one property. You can then specify here the indexes created.

Defined in

models/collections.ts:111


group

โ€ข Optional group: string

Optional field used to group top level navigation entries under a navigation view. If you set this value in a subcollection it has no effect.

Defined in

models/collections.ts:64


initialFilter

โ€ข Optional initialFilter: FilterValues<M>

Initial filters applied to this collection. Defaults to none.

Defined in

models/collections.ts:139


initialSort

โ€ข Optional initialSort: [Extract<keyof M, string>, "asc" | "desc"]

Default sort applied to this collection

Defined in

models/collections.ts:144


inlineEditing

โ€ข Optional inlineEditing: boolean

Can the elements in this collection be edited inline in the collection view. If this flag is set to false but permissions.edit is true, entities can still be edited in the side panel

Defined in

models/collections.ts:97


name

โ€ข name: string

Plural name of the view. E.g. 'products'

Defined in

models/collections.ts:22


pagination

โ€ข Optional pagination: number | boolean

If enabled, content is loaded in batches. If false all entities in the collection are loaded. You can specify a number to specify the pagination size (50 by default) Defaults to true

Defined in

models/collections.ts:72


path

โ€ข path: string

Relative path of this view to its parent. If this view is in the root the path is equal to the absolute one. This path also determines the URL in FireCMS

Defined in

models/collections.ts:34


permissions

โ€ข Optional permissions: PermissionsBuilder<M, UserType>

Permissions the logged-in user can perform on this collection. If not specified everything defaults to true

Defined in

models/collections.ts:90


properties

โ€ข Optional properties: (AdditionalKey | Extract<keyof M, string>)[]

Properties displayed in this collection. If this prop is not set every property is displayed

Defined in

models/collections.ts:45


schema

โ€ข schema: EntitySchema<M>

Schema representing the entities of this view

Defined in

models/collections.ts:39


selectionController

โ€ข Optional selectionController: SelectionController<M>

Pass your own selection controller if you want to control selected entities externally.

see useSelectionController

Defined in

models/collections.ts:157


selectionEnabled

โ€ข Optional selectionEnabled: boolean

Are the entities in this collection selectable. Defaults to true

Defined in

models/collections.ts:102


subcollections

โ€ข Optional subcollections: EntityCollection<any, any, any>[]

You can add subcollections to your entity in the same way you define the root collections. The collections added here will be displayed when opening the side dialog of an entity.

Defined in

models/collections.ts:126


textSearchEnabled

โ€ข Optional textSearchEnabled: boolean

Flag to indicate if a search bar should be displayed on top of the collection table.

Defined in

models/collections.ts:84

Methods

extraActions

โ–ธ Optional extraActions(extraActionsParams): ReactNode

Builder for rendering additional components such as buttons in the collection toolbar

Parameters

NameType
extraActionsParamsExtraActionsParams<M, UserType>

Returns

ReactNode

Defined in

models/collections.ts:150