Skip to main content

Interface: EntityCollection<M, AdditionalKey>

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
MM: Object = any
AdditionalKeyAdditionalKey: string = string

Properties#

additionalColumns#

Optional additionalColumns: AdditionalColumnDelegate<M, AdditionalKey>[]

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

Defined in#

models/collections.ts:77


callbacks#

Optional callbacks: EntityCallbacks<any>

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:132


defaultSize#

Optional defaultSize: CollectionSize

Default size of the rendered collection

Defined in#

models/collections.ts:56


description#

Optional description: string

Optional description of this view. You can use Markdown.

Defined in#

models/collections.ts:26


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:51


exportable#

Optional exportable: boolean | ExportConfig

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:118


extraActions#

Optional extraActions: (extraActionsParams: ExtraActionsParams<M>) => ReactNode

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

param this collection view

param current selected entities by the end user or undefined if none

Type declaration#

▸ (extraActionsParams): ReactNode

Parameters#
NameType
extraActionsParamsExtraActionsParams<M>
Returns#

ReactNode

Defined in#

models/collections.ts:152


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:110


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:63


initialFilter#

Optional initialFilter: FilterValues<M>

Initial filters applied to this collection. Defaults to none.

Defined in#

models/collections.ts:138


initialSort#

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

Default sort applied to this collection

Defined in#

models/collections.ts:143


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:96


name#

name: string

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

Defined in#

models/collections.ts:21


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:71


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:33


permissions#

Optional permissions: PermissionsBuilder<M>

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

Defined in#

models/collections.ts:89


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:44


schema#

schema: EntitySchema<M>

Schema representing the entities of this view

Defined in#

models/collections.ts:38


selectionEnabled#

Optional selectionEnabled: boolean

Are the entities in this collection selectable. Defaults to true

Defined in#

models/collections.ts:101


subcollections#

Optional subcollections: EntityCollection<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:125


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:83