Skip to content

@serenity-is/corelib / EntityGrid

Class: EntityGrid<TItem, P>

Defined in: src/ui/datagrid/entitygrid.ts:26

Base grid for entity-bound data; integrates routing, permissions, dialogs, toolbar buttons, filtering and service integration on top of DataGrid. Registered via modern static override [Symbol.typeInfo] = this.registerClass(...).

Extends

Type Parameters

TItem

TItem

Entity row type.

P

P = { }

Widget props type.

Constructors

Constructor

new EntityGrid<TItem, P>(props): EntityGrid<TItem, P>

Defined in: src/ui/datagrid/entitygrid.ts:33

Creates an entity grid and wires the route handler.

Parameters

props

WidgetProps<P>

Widget props forwarded to DataGrid.

Returns

EntityGrid<TItem, P>

Overrides

DataGrid.constructor

Properties

domNode

readonly domNode: HTMLElement

Defined in: src/ui/widgets/widget.ts:24

The DOM node this widget is bound to.

Inherited from

DataGrid.domNode


filterBar

protected filterBar: FilterDisplayBar

Defined in: src/ui/datagrid/datagrid.tsx:76

The advanced filter bar widget.

Inherited from

DataGrid.filterBar


idPrefix

readonly idPrefix: string

Defined in: src/ui/widgets/widget.ts:22

The id prefix used for this widget's child element ids.

Inherited from

DataGrid.idPrefix


onAfterInit

readonly onAfterInit: PubSub<DataGridEvent>

Defined in: src/ui/datagrid/datagrid.tsx:132

Raised after this grid is initialized.

Inherited from

DataGrid.onAfterInit


onCanSubmit

readonly onCanSubmit: PubSub<DataGridSubmitEvent>

Defined in: src/ui/datagrid/datagrid.tsx:134

Raised to determine whether the grid can submit its view.

Inherited from

DataGrid.onCanSubmit


onDataChanged

readonly onDataChanged: PubSub<DataGridEvent>

Defined in: src/ui/datagrid/datagrid.tsx:136

Raised when the grid data changes.

Inherited from

DataGrid.onDataChanged


onFiltering

readonly onFiltering: PubSub<DataGridFilteringEvent<TItem>>

Defined in: src/ui/datagrid/datagrid.tsx:138

Raised while filtering items in the view.

Inherited from

DataGrid.onFiltering


onPersistence

readonly onPersistence: PubSub<DataGridPersistenceEvent>

Defined in: src/ui/datagrid/datagrid.tsx:140

Raised before/after persisting or restoring grid settings.

Inherited from

DataGrid.onPersistence


onProcessData

readonly onProcessData: PubSub<DataGridProcessEvent<TItem>>

Defined in: src/ui/datagrid/datagrid.tsx:142

Raised when the view processes a list response.

Inherited from

DataGrid.onProcessData


onSetViewParams

readonly onSetViewParams: PubSub<DataGridEvent>

Defined in: src/ui/datagrid/datagrid.tsx:146

Raised after view parameters are prepared for submission.

Inherited from

DataGrid.onSetViewParams


onSubmitting

readonly onSubmitting: PubSub<DataGridSubmitEvent>

Defined in: src/ui/datagrid/datagrid.tsx:144

Raised to determine whether the view submit should proceed.

Inherited from

DataGrid.onSubmitting


openDialogsAsPanel

openDialogsAsPanel: boolean

Defined in: src/ui/datagrid/datagrid.tsx:91

Whether dialogs opened from this grid should be shown as panels.

Inherited from

DataGrid.openDialogsAsPanel


options

protected readonly options: WidgetProps<P>

Defined in: src/ui/widgets/widget.ts:18

The widget's options/props.

Inherited from

DataGrid.options


propertyItemsData

protected propertyItemsData: PropertyItemsData

Defined in: src/ui/datagrid/datagrid.tsx:84

The property items data for this grid.

Inherited from

DataGrid.propertyItemsData


quickFiltersBar

protected quickFiltersBar: QuickFilterBar

Defined in: src/ui/datagrid/datagrid.tsx:80

The quick filter bar widget.

Inherited from

DataGrid.quickFiltersBar


quickFiltersDiv

protected quickFiltersDiv: Fluent

Defined in: src/ui/datagrid/datagrid.tsx:78

The quick filters container element.

Inherited from

DataGrid.quickFiltersDiv


restoringSettings

protected restoringSettings: number

Defined in: src/ui/datagrid/datagrid.tsx:86

Counter tracking nested settings restoration.

Inherited from

DataGrid.restoringSettings


slickContainer

protected slickContainer: Fluent

Defined in: src/ui/datagrid/datagrid.tsx:82

The container element that hosts the grid.

Inherited from

DataGrid.slickContainer


titleDiv

protected titleDiv: Fluent

Defined in: src/ui/datagrid/datagrid.tsx:72

The title element.

Inherited from

DataGrid.titleDiv


toolbar

protected toolbar: Toolbar

Defined in: src/ui/datagrid/datagrid.tsx:74

The toolbar widget.

Inherited from

DataGrid.toolbar


uniqueName

readonly uniqueName: string

Defined in: src/ui/widgets/widget.ts:20

A unique name for this widget instance, used for event namespacing.

Inherited from

DataGrid.uniqueName


view

view: IRemoteView<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:88

The remote view used for paging and server communication.

Inherited from

DataGrid.view


[typeInfo]

static [typeInfo]: ClassTypeInfo<"Serenity.">

Defined in: src/ui/datagrid/entitygrid.ts:27

Overrides

DataGrid.[typeInfo]


defaultOptions

readonly static defaultOptions: object = dataGridDefaults

Defined in: src/ui/datagrid/datagrid.tsx:94

Default options shared by all data grid instances.

columnWidthDelta

columnWidthDelta: number

Default column width delta. This value if specified, is added to the width of columns defined server side. Default is null

columnWidthScale

columnWidthScale: number

Default column width scale. This value if specified, is multiplied with the width of columns defined server side. Default is null

displayTotalsRow

displayTotalsRow: boolean | "groupheader"

Where the totals of a group, e.g. the aggregates of the summary columns, are shown by default: on a row of their own (true), on the row of the group itself ("groupheader"), or not at all (false). It is passed to the view in getViewOptions, and is the default of the grouping levels that don't set it. Default is null, which leaves it to the groupingInfoDefaults of RemoteView, which is true, i.e. a row of their own.

editLinks: "primary" | "all"

How the columns with an edit link to the record of their row, e.g. the ones with the EditLink attribute and no item type of their own, show it: each as a link ("all"), or only the first visible one of them, the primary, while the others are quiet links, which look like the text of the cell until the row is hovered or the link has the focus, and open the record all the same ("primary"). Links to the records of other types are always shown. Default is null, which is "all".

enableAdvancedFiltering

enableAdvancedFiltering: boolean | (grid) => boolean

Controls whether to enable advanced filtering, e.g. via filter dialog/bar. Default is null.

indentDataRows

indentDataRows: boolean

Controls whether the first cell of the data rows inside a group is indented according to the grouping level, so the data rows line up under their group rows. It is passed to the view in getViewOptions, and to the group item metadata provider as its indentDataRows option. Default is null, which leaves it to GroupItemMetadataProvider.defaults.indentDataRows, which is true.

openDialogsAsPanel

openDialogsAsPanel: boolean

Controls whether to open dialogs as panels. Default is null.

persistenceFlags

persistenceFlags: GridPersistenceFlags = defaultGridPersistenceFlags

Default persistence flags. Defaults are true except quickSearch and quickFilterText

persistenceStorage

persistenceStorage: SettingStorage

Default persistence storage. Default is null

rowHeight

rowHeight: number

Default row height. Default is null.

serverAggregates

serverAggregates: boolean

Controls whether the views of the grids ask the server for the aggregates of the summary options, e.g. the totals in the footer, from all the rows and not only the page. Grids can override it in getViewOptions. Default is null, which is false.

Inherited from

DataGrid.defaultOptions


isComponent

readonly static isComponent: true = true

Defined in: src/ui/widgets/widget.ts:334

Inherited from

DataGrid.isComponent


onAfterInit

readonly static onAfterInit: PubSub<DataGridEvent>

Defined in: src/ui/datagrid/datagrid.tsx:130

Static event raised after any grid is initialized.

Inherited from

DataGrid.onAfterInit

Accessors

allColumns

Get Signature

get allColumns(): Column<any>[]

Defined in: src/ui/datagrid/datagrid.tsx:2098

All columns including hidden ones.

Returns

Column<any>[]

All columns from the underlying SleekGrid.

Inherited from

DataGrid.allColumns


columns

Get Signature

get columns(): Column<TItem>[]

Defined in: src/ui/datagrid/datagrid.tsx:2100

The currently visible columns.

Returns

Column<TItem>[]

Inherited from

DataGrid.columns


element

Get Signature

get element(): Fluent

Defined in: src/ui/widgets/widget.ts:82

Returns a Fluent(this.domNode) object

Returns

Fluent

Inherited from

DataGrid.element


initialSettings

Get Signature

get initialSettings(): PersistedGridSettings

Defined in: src/ui/datagrid/datagrid.tsx:2102

The initial persisted settings captured at startup.

Returns

PersistedGridSettings

Set Signature

set initialSettings(value): void

Defined in: src/ui/datagrid/datagrid.tsx:2104

Sets the initial persisted settings.

Parameters
value

PersistedGridSettings

Returns

void

Inherited from

DataGrid.initialSettings


props

Get Signature

get props(): WidgetProps<P>

Defined in: src/ui/widgets/widget.ts:307

Returns the widget's props/options.

Returns

WidgetProps<P>

Inherited from

DataGrid.props


readOnly

Get Signature

get readOnly(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:1537

Whether the grid is in read-only mode.

Returns

boolean

true if read-only, otherwise false.

Set Signature

set readOnly(value): void

Defined in: src/ui/datagrid/datagrid.tsx:1545

Sets whether the grid is in read-only mode.

Parameters
value

boolean

true to enable read-only mode, false to disable.

Returns

void

Inherited from

DataGrid.readOnly


rowSelector

Get Signature

get protected rowSelector(): GridRowSelectionMixin

Defined in: src/ui/datagrid/datagrid.tsx:254

The mixin of the check boxes that select the rows of the grid, if it has one, e.g. when a page created it, or when a columns class declares the column with a RowSelectionColumn attribute and ensureRowSelection created it. It is not stored by the grid, as the mixin keeps itself in a registry, which GridRowSelectionMixin.tryGetInstance reads. It is named rowSelector, and not rowSelection, so that it does not clash with the field of the same name that the pages keep.

Returns

GridRowSelectionMixin

Inherited from

DataGrid.rowSelector


sleekGrid

Get Signature

get sleekGrid(): ISleekGrid<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:2065

The underlying SleekGrid instance.

Returns

ISleekGrid<TItem>

The current SleekGrid instance.

Set Signature

set sleekGrid(value): void

Defined in: src/ui/datagrid/datagrid.tsx:2070

Sets the underlying SleekGrid instance.

Parameters
value

ISleekGrid<TItem>

SleekGrid instance to set.

Returns

void

Inherited from

DataGrid.sleekGrid


slickGrid

Get Signature

get slickGrid(): ISleekGrid<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:2076

Deprecated

Use sleekGrid or getGrid().

Returns

ISleekGrid<TItem>

The underlying SleekGrid instance.

Inherited from

DataGrid.slickGrid


defaultColumnWidthDelta

Get Signature

get static defaultColumnWidthDelta(): number

Defined in: src/ui/datagrid/datagrid.tsx:122

Default column width delta applied to all grids.

Returns

number

The current column width delta.

Set Signature

set static defaultColumnWidthDelta(value): void

Defined in: src/ui/datagrid/datagrid.tsx:127

Sets the default column width delta applied to all grids.

Parameters
value

number

Delta in pixels added to each column width.

Returns

void

Inherited from

DataGrid.defaultColumnWidthDelta


defaultColumnWidthScale

Get Signature

get static defaultColumnWidthScale(): number

Defined in: src/ui/datagrid/datagrid.tsx:112

Default column width scale applied to all grids.

Returns

number

The current column width scale.

Set Signature

set static defaultColumnWidthScale(value): void

Defined in: src/ui/datagrid/datagrid.tsx:117

Sets the default column width scale applied to all grids.

Parameters
value

number

Scale factor (e.g. 1.1 for 10% wider).

Returns

void

Inherited from

DataGrid.defaultColumnWidthScale


defaultPersistanceStorage

Get Signature

get static defaultPersistanceStorage(): SettingStorage

Defined in: src/ui/datagrid/datagrid.tsx:2110

Deprecated

Use defaultPersistenceStorage — this has a typo.

Returns

SettingStorage

The current persistence storage.

Set Signature

set static defaultPersistanceStorage(value): void

Defined in: src/ui/datagrid/datagrid.tsx:2115

Deprecated

Use defaultPersistenceStorage — this has a typo.

Parameters
value

SettingStorage

Persistence storage to set.

Returns

void

Inherited from

DataGrid.defaultPersistanceStorage


defaultPersistenceStorage

Get Signature

get static defaultPersistenceStorage(): SettingStorage

Defined in: src/ui/datagrid/datagrid.tsx:102

Default storage used for grid persistence.

Returns

SettingStorage

The current persistence storage.

Set Signature

set static defaultPersistenceStorage(value): void

Defined in: src/ui/datagrid/datagrid.tsx:107

Sets the default storage used for grid persistence.

Parameters
value

SettingStorage

Persistence storage to use (e.g. localStorage-backed).

Returns

void

Inherited from

DataGrid.defaultPersistenceStorage


defaultRowHeight

Get Signature

get static defaultRowHeight(): number

Defined in: src/ui/datagrid/datagrid.tsx:97

Default row height used when creating grids.

Returns

number

Inherited from

DataGrid.defaultRowHeight

Methods

addBooleanFilter()

protected addBooleanFilter(field, title?, yes?, no?): SelectEditor

Defined in: src/ui/datagrid/datagrid.tsx:1750

Adds a boolean quick filter for the specified field.

Parameters

field

string

Field name.

title?

string

Optional display title.

yes?

string

Optional text for the true option.

no?

string

Optional text for the false option.

Returns

SelectEditor

The created select editor.

Inherited from

DataGrid.addBooleanFilter


addButtonClick()

protected addButtonClick(): void

Defined in: src/ui/datagrid/entitygrid.ts:285

Handles the add button click by opening a new-item dialog.

Returns

void


addCssClass()

protected addCssClass(): void

Defined in: src/ui/widgets/widget.ts:89

Adds the widget's CSS class to its DOM node.

Returns

void

Inherited from

DataGrid.addCssClass


addDateRangeFilter()

protected addDateRangeFilter(field, title?): DateEditor

Defined in: src/ui/datagrid/datagrid.tsx:1708

Adds a date range quick filter for the specified field.

Parameters

field

string

Field name.

title?

string

Optional display title.

Returns

DateEditor

The created date editor.

Inherited from

DataGrid.addDateRangeFilter


addDateTimeRangeFilter()

protected addDateTimeRangeFilter(field, title?): DateTimeEditor<DateTimeEditorOptions>

Defined in: src/ui/datagrid/datagrid.tsx:1728

Adds a date-time range quick filter for the specified field.

Parameters

field

string

Field name.

title?

string

Optional display title.

Returns

DateTimeEditor<DateTimeEditorOptions>

The created date-time editor.

Inherited from

DataGrid.addDateTimeRangeFilter


addFilterSeparator()

protected addFilterSeparator(): void

Defined in: src/ui/datagrid/datagrid.tsx:1672

Adds a separator to the quick filter bar.

Returns

void

Inherited from

DataGrid.addFilterSeparator


addQuickFilter()

protected addQuickFilter<TWidget, P>(opt): TWidget

Defined in: src/ui/datagrid/datagrid.tsx:1698

Adds a quick filter to the quick filter bar.

Type Parameters

TWidget

TWidget extends Widget<any>

P

P

Parameters

opt

QuickFilter<TWidget, P>

Quick filter definition.

Returns

TWidget

The created widget instance.

Inherited from

DataGrid.addQuickFilter


addValidationRule()

Call Signature

addValidationRule(rule, uniqueName?): void

Defined in: src/ui/widgets/widget.ts:142

Adds a validation rule to the widget's DOM node.

Parameters
rule

(input) => string

The validation rule function, or a unique name when the two-argument overload is used.

uniqueName?

string

A unique name for the rule, or the rule function when the two-argument overload is used.

Returns

void

Inherited from

DataGrid.addValidationRule

Call Signature

addValidationRule(uniqueName, rule): void

Defined in: src/ui/widgets/widget.ts:143

Adds a validation rule to the widget's DOM node.

Parameters
uniqueName

string

A unique name for the rule, or the rule function when the two-argument overload is used.

rule

(input) => string

The validation rule function, or a unique name when the two-argument overload is used.

Returns

void

Inherited from

DataGrid.addValidationRule


afterInit()

protected afterInit(): void

Defined in: src/ui/datagrid/datagrid.tsx:276

Hook invoked after the grid is initialized and settings are restored.

Returns

void

Inherited from

DataGrid.afterInit


afterRender()

protected afterRender(callback): void

Defined in: src/ui/widgets/widget.ts:228

Queues a callback to run after the widget's contents are rendered.

Parameters

callback

() => void

The callback to run after rendering.

Returns

void

Inherited from

DataGrid.afterRender


autoRegisteringPlugin()

protected autoRegisteringPlugin(args): void

Defined in: src/ui/datagrid/datagrid.tsx:184

Hook invoked when the grid is registered as an auto-registering plugin.

Parameters

args

AutoRegisterArgs

Auto-registration arguments.

Returns

void

Inherited from

DataGrid.autoRegisteringPlugin


bindToSlickEvents()

protected bindToSlickEvents(): void

Defined in: src/ui/datagrid/datagrid.tsx:810

Subscribes to the underlying grid events.

Returns

void

Inherited from

DataGrid.bindToSlickEvents


bindToViewEvents()

protected bindToViewEvents(): void

Defined in: src/ui/datagrid/datagrid.tsx:901

Subscribes to view events for filtering, submitting, and processing data.

Returns

void

Inherited from

DataGrid.bindToViewEvents


booleanQuickFilter()

protected booleanQuickFilter(field, title?, yes?, no?): QuickFilter<SelectEditor<SelectEditorOptions>, SelectEditorOptions>

Defined in: src/ui/datagrid/datagrid.tsx:1762

Creates a boolean quick filter definition.

Parameters

field

string

Field name.

title?

string

Optional display title.

yes?

string

Optional text for the true option.

no?

string

Optional text for the false option.

Returns

QuickFilter<SelectEditor<SelectEditorOptions>, SelectEditorOptions>

A quick filter definition.

Inherited from

DataGrid.booleanQuickFilter


byId()

protected byId<TElement>(id): Fluent<TElement>

Defined in: src/ui/widgets/widget.ts:154

Finds a child element by its prefix-relative id.

Type Parameters

TElement

TElement extends HTMLElement = HTMLElement

Parameters

id

string

The id relative to the widget's id prefix.

Returns

Fluent<TElement>

A Fluent wrapper for the matching element.

Inherited from

DataGrid.byId


canFilterColumn()

protected canFilterColumn(column): boolean

Defined in: src/ui/datagrid/datagrid.tsx:624

Whether the given column can be used in the advanced filter bar.

Parameters

column

Column

Column to check.

Returns

boolean

True when the column is filterable.

Inherited from

DataGrid.canFilterColumn


change()

change(handler): void

Defined in: src/ui/widgets/widget.ts:179

Registers a change handler on the widget's DOM node.

Parameters

handler

(e) => void

The change event handler.

Returns

void

Inherited from

DataGrid.change


changeSelect2()

changeSelect2(handler): void

Defined in: src/ui/widgets/widget.ts:188

Registers a change handler that ignores changes originating from combobox setting values.

Parameters

handler

(e) => void

The change event handler.

Returns

void

Inherited from

DataGrid.changeSelect2


createColumns()

protected createColumns(): Column<TItem>[]

Defined in: src/ui/datagrid/datagrid.tsx:660

Creates initial column set for this grid. This column set is then passed to postProcessColumns to adjust widths etc, and then used as the initial columns for the slickgrid.

Returns

Column<TItem>[]

Inherited from

DataGrid.createColumns


createEntityDialog()

protected createEntityDialog(itemType, callback?): Widget<any> | PromiseLike<Widget<any>>

Defined in: src/ui/datagrid/entitygrid.ts:560

Creates a dialog widget for the specified item type, initializing and routing it.

Parameters

itemType

string

Entity type key whose dialog type will be resolved.

callback?

(dlg) => void

Optional callback invoked with the created dialog.

Returns

Widget<any> | PromiseLike<Widget<any>>

The dialog instance or a promise that resolves to it.


createFilterBar()

protected createFilterBar(): void

Defined in: src/ui/datagrid/entitygrid.ts:251

Creates the filter bar and syncs its visibility.

Returns

void

Overrides

DataGrid.createFilterBar


createIncludeDeletedButton()

protected createIncludeDeletedButton(): void

Defined in: src/ui/datagrid/entitygrid.ts:490

Creates the include-deleted toggle button when the row type supports it and the current user is allowed to undelete rows.

Returns

void

Overrides

DataGrid.createIncludeDeletedButton


createPager()

protected createPager(): void

Defined in: src/ui/datagrid/datagrid.tsx:1130

Creates the pager widget for this grid.

Returns

void

Inherited from

DataGrid.createPager


createQuickFilters()

protected createQuickFilters(filters?): void

Defined in: src/ui/datagrid/datagrid.tsx:385

Creates the quick filter bar with the given filters.

Parameters

filters?

QuickFilter<Widget<any>, any>[]

Quick filter definitions to render.

Returns

void

Inherited from

DataGrid.createQuickFilters


createQuickSearchInput()

protected createQuickSearchInput(): void

Defined in: src/ui/datagrid/datagrid.tsx:477

Creates the quick search input in the toolbar.

Returns

void

Inherited from

DataGrid.createQuickSearchInput


createSleekColumns()

protected createSleekColumns(): Column<TItem>[]

Defined in: src/ui/datagrid/datagrid.tsx:669

Creates the SleekGrid columns. This method calls createColumns (via getColumns for compatibility) and then post processes them.

Returns

Column<TItem>[]

The SleekGrid columns.

Inherited from

DataGrid.createSleekColumns


createSlickContainer()

protected createSlickContainer(): Fluent

Defined in: src/ui/datagrid/datagrid.tsx:1054

Creates the container element that hosts the grid.

Returns

Fluent

The grid container element.

Inherited from

DataGrid.createSlickContainer


createSlickGrid()

protected createSlickGrid(): ISleekGrid<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:678

Creates the underlying SleekGrid instance with the processed columns.

Returns

ISleekGrid<TItem>

The created grid instance.

Inherited from

DataGrid.createSlickGrid


createToolbar()

protected createToolbar(buttons): void

Defined in: src/ui/datagrid/datagrid.tsx:1167

Creates the toolbar with the given buttons.

Parameters

buttons

ToolButton[]

Tool button definitions.

Returns

void

Inherited from

DataGrid.createToolbar


createToolbarExtensions()

protected createToolbarExtensions(): void

Defined in: src/ui/datagrid/entitygrid.ts:110

Creates standard toolbar extensions such as the include-deleted toggle and quick search.

Returns

void

Overrides

DataGrid.createToolbarExtensions


createView()

protected createView(): IRemoteView<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:1062

Creates the remote view used for paging and server communication.

Returns

IRemoteView<TItem>

The remote view instance.

Inherited from

DataGrid.createView


dateRangeQuickFilter()

protected dateRangeQuickFilter(field, title?): QuickFilter<DateEditor<DateEditorOptions>, DateTimeEditorOptions>

Defined in: src/ui/datagrid/datagrid.tsx:1718

Creates a date range quick filter definition.

Parameters

field

string

Field name.

title?

string

Optional display title.

Returns

QuickFilter<DateEditor<DateEditorOptions>, DateTimeEditorOptions>

A quick filter definition.

Inherited from

DataGrid.dateRangeQuickFilter


dateTimeRangeQuickFilter()

protected dateTimeRangeQuickFilter(field, title?): QuickFilter<DateTimeEditor<DateTimeEditorOptions>, DateTimeEditorOptions>

Defined in: src/ui/datagrid/datagrid.tsx:1738

Creates a date-time range quick filter definition.

Parameters

field

string

Field name.

title?

string

Optional display title.

Returns

QuickFilter<DateTimeEditor<DateTimeEditorOptions>, DateTimeEditorOptions>

A quick filter definition.

Inherited from

DataGrid.dateTimeRangeQuickFilter


deferRender()

protected deferRender(): boolean

Defined in: src/ui/widgets/widget.ts:98

Determines whether rendering should be deferred until init is called.

Returns

boolean

True to defer rendering.

Inherited from

DataGrid.deferRender


destroy()

destroy(): void

Defined in: src/ui/datagrid/entitygrid.ts:42

Cleans up the route-fixup handler and delegates to the base destroy.

Returns

void

Overrides

DataGrid.destroy


determineText()

protected determineText(getKey): string

Defined in: src/ui/datagrid/datagrid.tsx:1681

Resolves a localized text using the grid's local text db prefix.

Parameters

getKey

(prefix) => string

Callback that builds the text key from the prefix.

Returns

string

The localized text, or null if not found.

Inherited from

DataGrid.determineText


editItem()

protected editItem(entityOrId): void

Defined in: src/ui/datagrid/entitygrid.ts:293

Opens an edit dialog for an existing entity or a new instance.

Parameters

entityOrId

any

Entity instance or identifier to edit.

Returns

void

Overrides

DataGrid.editItem


editItemOfType()

protected editItemOfType(itemType, entityOrId): void

Defined in: src/ui/datagrid/entitygrid.ts:346

Opens an edit dialog for a specific item type, used for polymorphic entities.

Parameters

itemType

string

Entity type key.

entityOrId

any

Entity instance or identifier to edit.

Returns

void

Overrides

DataGrid.editItemOfType


EditLink(props): any

Defined in: src/ui/datagrid/datagrid.tsx:1234

Renders an edit link for the item in current row. Returns a DocumentFragment for non-data rows, and an anchor element otherwise.

Parameters

props
children?

any

The link text. If not provided it will be taken from ctx.escape(ctx.value)

context?

FormatterContext

formatter context (contains item, value etc)

cssClass?

string

Extra CSS class to add to the link element besides s-EditLink. Optional.

id?

string

The id of the entity to link to. If not provided it will be taken from ctx.item[idField]

idField?

string

The name of the field in item that contains the entity id. Defaults to idProperty. Used if id is not provided.

itemType?

string

The item type to link to. Defaults to this.getItemType()

tabindex?

number

The tabindex to assign to the link, default is undefined

tabIndex?

number

Deprecated

Use tabindex.

Returns

any

Inherited from

DataGrid.EditLink


enableAdvancedFiltering()

protected enableAdvancedFiltering(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:1087

Whether advanced filtering is enabled for this grid.

Returns

boolean

True when advanced filtering is enabled.

Inherited from

DataGrid.enableAdvancedFiltering


ensureQuickFilterBar()

protected ensureQuickFilterBar(): QuickFilterBar

Defined in: src/ui/datagrid/datagrid.tsx:373

Ensures the quick filter bar exists and returns it.

Returns

QuickFilterBar

The quick filter bar instance.

Inherited from

DataGrid.ensureQuickFilterBar


filterStoreChanged()

protected filterStoreChanged(): void

Defined in: src/ui/datagrid/entitygrid.ts:259

Invoked when the filter store changes; refreshes the filter bar visibility.

Returns

void

Overrides

DataGrid.filterStoreChanged


findById()

protected findById<TElement>(id): TElement

Defined in: src/ui/widgets/widget.ts:163

Finds a child element by its prefix-relative id.

Type Parameters

TElement

TElement extends HTMLElement = HTMLElement

Parameters

id

string

The id relative to the widget's id prefix.

Returns

TElement

The matching element, or null if not found.

Inherited from

DataGrid.findById


findQuickFilter()

protected findQuickFilter<TWidget>(type, field): TWidget

Defined in: src/ui/datagrid/datagrid.tsx:436

Finds a quick filter widget by field name.

Type Parameters

TWidget

TWidget

Parameters

type

(...args) => TWidget

Widget constructor type.

field

string

Field name of the quick filter.

Returns

TWidget

The widget instance.

Inherited from

DataGrid.findQuickFilter


get_readOnly()

get_readOnly(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:1553

Returns whether the grid is in read-only mode.

Returns

boolean

True when read-only.

Inherited from

DataGrid.get_readOnly


getAddButtonCaption()

protected getAddButtonCaption(): string

Defined in: src/ui/datagrid/entitygrid.ts:196

Returns the caption for the add/new button.

Returns

string

Localized add button text.

Overrides

DataGrid.getAddButtonCaption


getButtons()

protected getButtons(): ToolButton[]

Defined in: src/ui/datagrid/entitygrid.ts:204

Builds the grid toolbar buttons including add, refresh, column picker and filter bar.

Returns

ToolButton[]

Array of tool button definitions.

Overrides

DataGrid.getButtons


getColumns()

protected getColumns(): Column<TItem>[]

Defined in: src/ui/datagrid/datagrid.tsx:1338

Returns

Column<TItem>[]

Deprecated

override createColumns

Inherited from

DataGrid.getColumns


getColumnsKey()

protected getColumnsKey(): string

Defined in: src/ui/datagrid/datagrid.tsx:1280

Returns the columns key used to load property items.

Returns

string

The columns key, or null for none.

Inherited from

DataGrid.getColumnsKey


getColumnsRevision()

protected getColumnsRevision(): number

Defined in: src/ui/datagrid/datagrid.tsx:1288

Returns the columns revision used to detect incompatible persisted column layouts.

Returns

number

The columns revision number (0 means no revision).

Inherited from

DataGrid.getColumnsRevision


getColumnWidthDelta()

protected getColumnWidthDelta(): number

Defined in: src/ui/datagrid/datagrid.tsx:589

Returns the width delta applied to all columns.

Returns

number

The column width delta.

Inherited from

DataGrid.getColumnWidthDelta


getColumnWidthScale()

protected getColumnWidthScale(): number

Defined in: src/ui/datagrid/datagrid.tsx:597

Returns the width scale applied to all columns.

Returns

number

The column width scale.

Inherited from

DataGrid.getColumnWidthScale


getCssClass()

protected getCssClass(): string

Defined in: src/ui/widgets/widget.ts:106

Returns the CSS class(es) applied to the widget's DOM node.

Returns

string

The space-separated CSS class string.

Inherited from

DataGrid.getCssClass


getCurrentSettings()

getCurrentSettings(flags?): PersistedGridSettings

Defined in: src/ui/datagrid/datagrid.tsx:2012

Returns the current grid settings snapshot.

Parameters

flags?

GridPersistenceFlags

Optional persistence flags.

Returns

PersistedGridSettings

The current grid settings.

Inherited from

DataGrid.getCurrentSettings


getCustomAttribute()

protected getCustomAttribute<TAttr>(attrType, inherit): TAttr

Defined in: src/ui/widgets/widget.ts:220

Returns a custom attribute applied to the widget's type.

Type Parameters

TAttr

TAttr extends CustomAttribute

Parameters

attrType

(...args) => TAttr

The attribute type to look up.

inherit

boolean = true

Whether to search inherited types; defaults to true.

Returns

TAttr

The matching attribute, or null.

Inherited from

DataGrid.getCustomAttribute


getDefaultSortBy()

protected getDefaultSortBy(): any[]

Defined in: src/ui/datagrid/datagrid.tsx:1071

Returns the default sort order for the grid.

Returns

any[]

Array of sort descriptors.

Inherited from

DataGrid.getDefaultSortBy


getDeletePermission()

protected getDeletePermission(): string

Defined in: src/ui/datagrid/entitygrid.ts:456

Returns the permission key required to delete a row.

Returns

string

Delete permission or undefined.


getDialogOptions()

protected getDialogOptions(): any

Defined in: src/ui/datagrid/entitygrid.ts:585

Returns default options for the primary entity dialog.

Returns

any

Dialog options.


getDialogOptionsFor()

protected getDialogOptionsFor(itemType): any

Defined in: src/ui/datagrid/entitygrid.ts:594

Returns dialog options for a specific item type.

Parameters

itemType

string

Entity type key.

Returns

any

Dialog options for that type.


getDialogType()

protected getDialogType(): DialogType | PromiseLike<DialogType>

Defined in: src/ui/datagrid/entitygrid.ts:621

Resolves the dialog type for the primary entity; cached and may be loaded lazily.

Returns

DialogType | PromiseLike<DialogType>

Dialog constructor or a promise that resolves to it.


getDialogTypeFor()

protected getDialogTypeFor(itemType): DialogType | PromiseLike<DialogType>

Defined in: src/ui/datagrid/entitygrid.ts:606

Resolves the dialog type for the given item type.

Parameters

itemType

string

Entity type key.

Returns

DialogType | PromiseLike<DialogType>

Dialog constructor or a promise that resolves to it.


getDisplayName()

protected getDisplayName(): string

Defined in: src/ui/datagrid/entitygrid.ts:172

Returns the localized plural display name for the entity.

Returns

string

Display name for the grid title.


protected getEditLinks(): "primary" | "all"

Defined in: src/ui/datagrid/datagrid.tsx:1378

Returns how the columns with an edit link to the record of their row show it, "all" for each as a link, or "primary" for only the primary one, see getPrimaryEditLinkColumn, while the others are quiet links. A column whose EditLink attribute sets Quiet (the editLinkQuiet of its property item) is quiet or a full link as it says, in both. Defaults to DataGrid.defaultOptions.editLinks, which is "all" when not set.

Returns

"primary" | "all"

Inherited from

DataGrid.getEditLinks


getElement()

getElement(): HTMLElement

Defined in: src/ui/datagrid/datagrid.tsx:2049

Returns the root DOM element of the grid widget.

Returns

HTMLElement

The grid container element.

Inherited from

DataGrid.getElement


getEntityType()

protected getEntityType(): string

Defined in: src/ui/datagrid/entitygrid.ts:143

Returns the entity type name derived from the grid class name.

Returns

string

Entity type (e.g. "Administration.User").


getFilterStore()

getFilterStore(): FilterStore

Defined in: src/ui/datagrid/datagrid.tsx:2090

Returns the filter store owned by the grid.

Returns

FilterStore

The filter store, or null if no filter bar exists.

Inherited from

DataGrid.getFilterStore


getGrid()

getGrid(): ISleekGrid<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:2057

Returns the underlying SleekGrid instance.

Returns

ISleekGrid<TItem>

The grid instance.

Inherited from

DataGrid.getGrid


getGridCanLoad()

protected getGridCanLoad(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:1475

Determines whether the grid can load data, notifying onCanSubmit subscribers.

Returns

boolean

True when the grid can load.

Inherited from

DataGrid.getGridCanLoad


getGridField()

getGridField(): Fluent

Defined in: src/ui/widgets/widget.ts:171

Returns the closest .field element containing the widget's DOM node.

Returns

Fluent

A Fluent wrapper for the grid field.

Inherited from

DataGrid.getGridField


getIdProperty()

protected getIdProperty(): string

Defined in: src/ui/datagrid/datagrid.tsx:1619

Returns the id property name for this grid.

Returns

string

The id property name.

Inherited from

DataGrid.getIdProperty


getIncludeColumns()

protected getIncludeColumns(include): void

Defined in: src/ui/datagrid/datagrid.tsx:970

Collects the fields and referenced fields of all columns into the given map.

Parameters

include

Map to populate with column field names.

Returns

void

Inherited from

DataGrid.getIncludeColumns


getInitialGridStyle()

protected getInitialGridStyle(): GridStyle

Defined in: src/ui/datagrid/datagrid.tsx:293

What the grid hides of the look its theme gives to grids, so it looks more like a plain table, which is nothing by default, so the grid looks as the theme says. It is called while the grid is being created, so it can only use the options and static values.

Returns

GridStyle

The members of GridStyle to apply, combined, or null.

Inherited from

DataGrid.getInitialGridStyle


getInitialTitle()

protected getInitialTitle(): RenderableContent

Defined in: src/ui/datagrid/entitygrid.ts:119

Returns the initial title for the grid panel.

Returns

RenderableContent

Localized plural display name.

Overrides

DataGrid.getInitialTitle


getInsertPermission()

protected getInsertPermission(): string

Defined in: src/ui/datagrid/entitygrid.ts:440

Returns the permission key required to insert a row.

Returns

string

Insert permission or undefined if none is configured.


getIsActiveProperty()

protected getIsActiveProperty(): string

Defined in: src/ui/datagrid/datagrid.tsx:1644

Returns the is-active property name for this grid.

Returns

string

The is-active property name.

Inherited from

DataGrid.getIsActiveProperty


getIsDeletedProperty()

protected getIsDeletedProperty(): string

Defined in: src/ui/datagrid/datagrid.tsx:1634

Returns the is-deleted property name for this grid.

Returns

string

The is-deleted property name, or undefined.

Inherited from

DataGrid.getIsDeletedProperty


getItemCssClass()

protected getItemCssClass(item, index): string

Defined in: src/ui/datagrid/datagrid.tsx:541

Returns the CSS class for a grid row based on its active/deleted state.

Parameters

item

TItem

The row item.

index

number

The row index.

Returns

string

The CSS class name, or an empty string.

Inherited from

DataGrid.getItemCssClass


getItemMetadata()

protected getItemMetadata(item, index): any

Defined in: src/ui/datagrid/datagrid.tsx:551

Returns row metadata (e.g. CSS classes) for the given item.

Parameters

item

TItem

The row item.

index

number

The row index.

Returns

any

Row metadata object.

Inherited from

DataGrid.getItemMetadata


getItemName()

protected getItemName(): string

Defined in: src/ui/datagrid/entitygrid.ts:185

Returns the localized singular name for a single entity item.

Returns

string

Singular display name.


getItems()

getItems(): TItem[]

Defined in: src/ui/datagrid/datagrid.tsx:749

Returns the items currently displayed in the grid.

Returns

TItem[]

The grid items.

Inherited from

DataGrid.getItems


getItemType()

protected getItemType(): string

Defined in: src/ui/datagrid/entitygrid.ts:411

Returns the entity item type key used to resolve dialogs and row definitions.

Returns

string

Item type key.

Overrides

DataGrid.getItemType


getLocalTextDbPrefix()

protected getLocalTextDbPrefix(): string

Defined in: src/ui/datagrid/datagrid.tsx:1589

Returns the local text database prefix for this grid.

Returns

string

The local text db prefix.

Inherited from

DataGrid.getLocalTextDbPrefix


getLocalTextPrefix()

protected getLocalTextPrefix(): string

Defined in: src/ui/datagrid/entitygrid.ts:127

Resolves the local text prefix for this grid; falls back to the entity type.

Returns

string

Local text prefix key.

Overrides

DataGrid.getLocalTextPrefix


getPagerOptions()

protected getPagerOptions(): PagerOptions

Defined in: src/ui/datagrid/datagrid.tsx:1119

Returns the pager options for this grid.

Returns

PagerOptions

Pager options.

Inherited from

DataGrid.getPagerOptions


getPersistedSettings()

protected getPersistedSettings(): PersistedGridSettings | Promise<PersistedGridSettings>

Defined in: src/ui/datagrid/datagrid.tsx:1826

Retrieves the persisted grid settings from storage.

Returns

PersistedGridSettings | Promise<PersistedGridSettings>

The persisted settings, or a promise resolving to them.

Inherited from

DataGrid.getPersistedSettings


getPersistenceKey()

protected getPersistenceKey(): string

Defined in: src/ui/datagrid/datagrid.tsx:1799

Returns the key used to store grid settings.

Returns

string

The persistence key.

Inherited from

DataGrid.getPersistenceKey


getPersistenceStorage()

protected getPersistenceStorage(): SettingStorage

Defined in: src/ui/datagrid/datagrid.tsx:1789

Returns the storage used for grid persistence.

Returns

SettingStorage

The persistence storage.

Inherited from

DataGrid.getPersistenceStorage


getPrimaryEditLinkColumn()

protected getPrimaryEditLinkColumn(columns): Column

Defined in: src/ui/datagrid/datagrid.tsx:1392

Returns the column whose edit link to the record of its row is shown as a link, when getEditLinks is "primary": the first visible one, in the order they are shown, so that another one takes its place when it is hidden or moved. It is called again after the columns change. A column that is quiet by its EditLink attribute is not one of them, while one that is a full link by it is, so that the ones after it are quiet.

Parameters

columns

Column<any>[]

The visible columns with an edit link to the record of their row, which are not quiet by their attribute, in the order shown.

Returns

Column

The primary column, or null for none.

Inherited from

DataGrid.getPrimaryEditLinkColumn


getPropertyItems()

protected getPropertyItems(): PropertyItem[]

Defined in: src/ui/datagrid/datagrid.tsx:1296

Returns the property items for this grid.

Returns

PropertyItem[]

The property items.

Inherited from

DataGrid.getPropertyItems


getPropertyItemsData()

protected getPropertyItemsData(): PropertyItemsData

Defined in: src/ui/datagrid/datagrid.tsx:1304

Loads the property items data, either from script data or local items.

Returns

PropertyItemsData

The property items data.

Inherited from

DataGrid.getPropertyItemsData


getPropertyItemsDataAsync()

protected getPropertyItemsDataAsync(): Promise<PropertyItemsData>

Defined in: src/ui/datagrid/datagrid.tsx:1328

Asynchronously loads the property items data.

Returns

Promise<PropertyItemsData>

A promise resolving to the property items data.

Inherited from

DataGrid.getPropertyItemsDataAsync


getQuickFilters()

protected getQuickFilters(): QuickFilter<Widget<any>, any>[]

Defined in: src/ui/datagrid/datagrid.tsx:411

Returns the quick filter definitions derived from the grid columns.

Returns

QuickFilter<Widget<any>, any>[]

Quick filter definitions for columns marked as quick filters.

Inherited from

DataGrid.getQuickFilters


getQuickSearchFields()

protected getQuickSearchFields(): QuickSearchField[]

Defined in: src/ui/datagrid/datagrid.tsx:470

Returns the quick search fields available for this grid.

Returns

QuickSearchField[]

The quick search fields, or null for none.

Inherited from

DataGrid.getQuickSearchFields


getRecordViews()

getRecordViews(): RecordViewInfo[]

Defined in: src/ui/datagrid/datagrid.tsx:243

Returns the record views that the columns class of the grid has as a whole, e.g. a card view that is an alternate view of its rows, from the RecordViewTypeAttributes on the class, which the mixins of the grid read to create the views, e.g. CardViewMixin of Serenity.Pro.Extensions. The ones of a property are on its column.

Returns

RecordViewInfo[]

The record views, an empty list when there are none.

Inherited from

DataGrid.getRecordViews


getRowDefinition()

protected getRowDefinition(): IRowDefinition

Defined in: src/ui/datagrid/datagrid.tsx:1579

Returns the row definition for this grid.

Returns

IRowDefinition

The row definition, or null for none.

Inherited from

DataGrid.getRowDefinition


getService()

protected getService(): string

Defined in: src/ui/datagrid/entitygrid.ts:374

Returns the service endpoint path for the entity (e.g. "Administration/User").

Returns

string

Service path derived from the entity type.


getServiceMethod()

protected getServiceMethod(): string

Defined in: src/ui/datagrid/entitygrid.ts:385

Returns the service method name for listing entities.

Returns

string

Service method (defaults to "/List").


getServiceUrl()

protected getServiceUrl(): string

Defined in: src/ui/datagrid/entitygrid.ts:393

Returns the absolute URL for the list service endpoint.

Returns

string

Resolved service URL.


getSlickOptions()

protected getSlickOptions(): GridOptions

Defined in: src/ui/datagrid/datagrid.tsx:1443

Returns the SleekGrid options for this grid.

Returns

GridOptions

Grid options.

Inherited from

DataGrid.getSlickOptions


getTitle()

getTitle(): string

Defined in: src/ui/datagrid/datagrid.tsx:1179

Returns the current grid title text.

Returns

string

The title text, or null if no title is set.

Inherited from

DataGrid.getTitle


getUndeletePermission()

protected getUndeletePermission(): string

Defined in: src/ui/datagrid/entitygrid.ts:473

Returns the permission key required to undelete a row.

Returns

string

Undelete permission or undefined.


getUpdatePermission()

protected getUpdatePermission(): string

Defined in: src/ui/datagrid/entitygrid.ts:448

Returns the permission key required to update a row.

Returns

string

Update permission or undefined.


getView()

getView(): IRemoteView<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:2082

Returns the remote view used for paging and server communication.

Returns

IRemoteView<TItem>

The remote view instance.

Inherited from

DataGrid.getView


getViewOptions()

protected getViewOptions(): RemoteViewOptions

Defined in: src/ui/datagrid/entitygrid.ts:401

Returns view options including the service URL.

Returns

RemoteViewOptions

Remote view options with URL populated.

Overrides

DataGrid.getViewOptions


gridPersistenceFlags()

protected gridPersistenceFlags(): GridPersistenceFlags

Defined in: src/ui/datagrid/datagrid.tsx:1816

Returns the default persistence flags for this grid. Restore options apply to automatic storage restores.

Returns

GridPersistenceFlags

Grid persistence flags.

Inherited from

DataGrid.gridPersistenceFlags


handleGridClick()

protected handleGridClick(e): void

Defined in: src/ui/datagrid/datagrid.tsx:774

Handles grid cell click events by delegating to onClick.

Parameters

e

CellMouseEvent

Cell mouse event.

Returns

void

Inherited from

DataGrid.handleGridClick


handleGridColumnsReordered()

protected handleGridColumnsReordered(): void

Defined in: src/ui/datagrid/datagrid.tsx:789

Persists settings when columns are reordered.

Returns

void

Inherited from

DataGrid.handleGridColumnsReordered


handleGridColumnsResized()

protected handleGridColumnsResized(): void

Defined in: src/ui/datagrid/datagrid.tsx:796

Persists settings when columns are resized.

Returns

void

Inherited from

DataGrid.handleGridColumnsResized


handleGridKeyDown()

protected handleGridKeyDown(e): void

Defined in: src/ui/datagrid/datagrid.tsx:782

Handles grid key down events by delegating to onKeyDown.

Parameters

e

CellKeyboardEvent

Cell keyboard event.

Returns

void

Inherited from

DataGrid.handleGridKeyDown


handleGridSort()

protected handleGridSort(e): void

Defined in: src/ui/datagrid/datagrid.tsx:765

Handles grid sort events by applying the sort and persisting settings.

Parameters

e

GridSortEvent

Grid sort event.

Returns

void

Inherited from

DataGrid.handleGridSort


handleRoute()

protected handleRoute(e): void

Defined in: src/ui/datagrid/entitygrid.ts:51

Handles hash-based routing for new/edit dialog invocations.

Parameters

e

HandleRouteEvent

Route event containing the hash fragment and navigation metadata.

Returns

void


handleViewFilter()

protected handleViewFilter(item): boolean

Defined in: src/ui/datagrid/datagrid.tsx:914

Filters a view item, notifying the onFiltering subscribers.

Parameters

item

TItem

The item to filter.

Returns

boolean

True when the item matches.

Inherited from

DataGrid.handleViewFilter


handleViewProcessData()

protected handleViewProcessData(response): ListResponse<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:928

Processes a list response, notifying the onProcessData subscribers.

Parameters

response

ListResponse<TItem>

The list response.

Returns

ListResponse<TItem>

The processed response.

Inherited from

DataGrid.handleViewProcessData


handleViewSubmit()

protected handleViewSubmit(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:939

Handles view submission, notifying the onSubmitting subscribers.

Returns

boolean

True when the submit should proceed.

Inherited from

DataGrid.handleViewSubmit


hasDeletePermission()

protected hasDeletePermission(): boolean

Defined in: src/ui/datagrid/entitygrid.ts:464

Checks whether the current user may delete rows.

Returns

boolean

True when deletion is allowed.


hasInsertPermission()

protected hasInsertPermission(): boolean

Defined in: src/ui/datagrid/entitygrid.ts:499

Checks whether the current user may insert rows.

Returns

boolean

True when insertion is allowed.


hasUndeletePermission()

protected hasUndeletePermission(): boolean

Defined in: src/ui/datagrid/entitygrid.ts:481

Checks whether the current user may undelete rows.

Returns

boolean

True when undeletion is allowed.


hasUpdatePermission()

protected hasUpdatePermission(): boolean

Defined in: src/ui/datagrid/entitygrid.ts:508

Checks whether the current user may update rows.

Returns

boolean

True when updates are allowed.


init()

init(): this

Defined in: src/ui/widgets/widget.ts:243

Initializes the widget, rendering its contents if rendering was deferred.

Returns

this

This widget instance.

Inherited from

DataGrid.init


initDialog()

protected initDialog(dialog): void

Defined in: src/ui/datagrid/entitygrid.ts:526

Initializes a dialog bound to the primary item type.

Parameters

dialog

Widget<any>

Dialog instance to initialize.

Returns

void


initEntityDialog()

protected initEntityDialog(itemType, dialog): void

Defined in: src/ui/datagrid/entitygrid.ts:540

Initializes a dialog for the given item type, wiring data-change and routing.

Parameters

itemType

string

Entity type key.

dialog

Widget<any>

Dialog instance to initialize.

Returns

void


initializeFilterBar()

protected initializeFilterBar(): void

Defined in: src/ui/datagrid/datagrid.tsx:634

Initializes the filter bar store with the filterable columns.

Returns

void

Inherited from

DataGrid.initializeFilterBar


initialPopulate()

protected initialPopulate(): void

Defined in: src/ui/datagrid/datagrid.tsx:604

Performs the initial data population, optionally waiting until visible.

Returns

void

Inherited from

DataGrid.initialPopulate


initRowSelector()

protected initRowSelector(): void

Defined in: src/ui/datagrid/datagrid.tsx:264

Creates the row selection mixin of the grid when its columns have the column of the check boxes that select the rows, which a columns class gets with a RowSelectionColumn attribute of the server, so that a page does not have to create the mixin, nor add the column itself. The mixin keeps itself in a registry of its own, so a page that created one already keeps it, and the grid does not hold it.

Returns

void

Inherited from

DataGrid.initRowSelector


initSleekGrid()

protected initSleekGrid(): void

Defined in: src/ui/datagrid/datagrid.tsx:690

Hook for subclasses to initialize the grid after creation.

Returns

void

Inherited from

DataGrid.initSleekGrid


internalRefresh()

protected internalRefresh(): void

Defined in: src/ui/datagrid/datagrid.tsx:1527

Performs the actual data refresh by populating the view.

Returns

void

Inherited from

DataGrid.internalRefresh


internalRenderContents()

internalRenderContents(): void

Defined in: src/ui/widgets/widget.ts:266

Renders the widget's contents and runs any queued after-render callbacks.

Returns

void

Inherited from

DataGrid.internalRenderContents


invokeSubmitHandlers()

protected invokeSubmitHandlers(): void

Defined in: src/ui/datagrid/datagrid.tsx:1769

Invokes the quick filter submit handlers with the current view params.

Returns

void

Inherited from

DataGrid.invokeSubmitHandlers


isQuietEditLinkColumn()

protected isQuietEditLinkColumn(column): boolean

Defined in: src/ui/datagrid/datagrid.tsx:1401

Tells whether the edit link of a column is a quiet one: as its EditLink attribute says when it sets Quiet, and otherwise when it links to the record of its row and is not the primary one, see getEditLinks.

Parameters

column

Column

The column.

Returns

boolean

Inherited from

DataGrid.isQuietEditLinkColumn


itemAt()

itemAt(row): TItem

Defined in: src/ui/datagrid/datagrid.tsx:724

Returns the item at the given row index.

Parameters

row

number

Row index.

Returns

TItem

The item at that row.

Inherited from

DataGrid.itemAt


itemId()

itemId(item): any

Defined in: src/ui/datagrid/datagrid.tsx:733

Returns the id of the given item using the grid id property.

Parameters

item

TItem

The item.

Returns

any

The item id.

Inherited from

DataGrid.itemId


protected itemLink(itemType?, idField?, text?, cssClass?, encode?): Format<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:1228

Creates a formatter that renders a link to an item.

Parameters

itemType?

string

Item type key; defaults to the grid item type.

idField?

string

Id field name; defaults to the grid id property.

text?

Format<TItem>

Optional text formatter.

cssClass?

(ctx) => string

Optional CSS class formatter.

encode?

boolean = true

Whether to HTML-encode the link text.

Returns

Format<TItem>

A formatter function.

Inherited from

DataGrid.itemLink


layout()

protected layout(): void

Defined in: src/ui/datagrid/datagrid.tsx:330

Recalculates the grid layout, handling responsive height behavior.

Returns

void

Inherited from

DataGrid.layout


legacyTemplateRender()

protected legacyTemplateRender(): boolean

Defined in: src/ui/widgets/widget.ts:291

Renders the widget from a legacy getTemplate string, if defined.

Returns

boolean

True if a legacy template was rendered.

Inherited from

DataGrid.legacyTemplateRender


markupReady()

protected markupReady(): void

Defined in: src/ui/datagrid/datagrid.tsx:1046

Hook invoked when the grid markup is ready after data changes.

Returns

void

Inherited from

DataGrid.markupReady


newRefreshButton()

protected newRefreshButton(noText?): ToolButton

Defined in: src/ui/datagrid/entitygrid.ts:269

Creates a refresh toolbar button.

Parameters

noText?

boolean

When true, only an icon with a hint is shown.

Returns

ToolButton

Tool button definition for refreshing the grid.


onClick()

protected onClick(e, row, cell): void

Defined in: src/ui/datagrid/datagrid.tsx:863

Handles cell clicks, opening edit links when clicked.

Parameters

e

Event

Click event.

row

number

Row index.

cell

number

Cell index.

Returns

void

Inherited from

DataGrid.onClick


onKeyDown()

protected onKeyDown(e, row, cell): void

Defined in: src/ui/datagrid/entitygrid.ts:318

Opens the dialog of the row of the cursor on Enter, like a click on its edit link, when the grid navigates rows (enableCellNavigation: "row"), e.g. a list whose rows open a dialog. A grid whose cells are edited in place leaves Enter to its cell editors.

Parameters

e

CellKeyboardEvent

Cell keyboard event.

row

number

Row index of the cursor.

cell

number

Cell index of the cursor.

Returns

void

Overrides

DataGrid.onKeyDown


onViewFilter()

protected onViewFilter(item): boolean

Defined in: src/ui/datagrid/datagrid.tsx:962

Hook for subclasses to filter view items.

Parameters

item

TItem

The item to filter.

Returns

boolean

True when the item should be included.

Inherited from

DataGrid.onViewFilter


onViewProcessData()

protected onViewProcessData(response): ListResponse<TItem>

Defined in: src/ui/datagrid/datagrid.tsx:953

Hook for subclasses to process a list response before it is applied.

Parameters

response

ListResponse<TItem>

The list response.

Returns

ListResponse<TItem>

The processed response.

Inherited from

DataGrid.onViewProcessData


onViewSubmit()

protected onViewSubmit(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:1034

Hook invoked before the view submits; prepares parameters and checks loadability.

Returns

boolean

True when the view can load.

Inherited from

DataGrid.onViewSubmit


persistenceLock()

persistenceLock(): void

Defined in: src/ui/datagrid/datagrid.tsx:1978

Increments the persistence lock, preventing settings from being persisted.

Returns

void

Inherited from

DataGrid.persistenceLock


persistenceUnlock()

persistenceUnlock(): void

Defined in: src/ui/datagrid/datagrid.tsx:1985

Decrements the persistence lock.

Returns

void

Inherited from

DataGrid.persistenceUnlock


persistSettings()

persistSettings(flags?): void | Promise<void>

Defined in: src/ui/datagrid/datagrid.tsx:1994

Persists the current grid settings to storage.

Parameters

flags?

GridPersistenceFlags

Optional persistence flags.

Returns

void | Promise<void>

Void or a promise that resolves when the write completes.

Inherited from

DataGrid.persistSettings


populateLock()

protected populateLock(): void

Defined in: src/ui/datagrid/datagrid.tsx:1460

Locks the view against population.

Returns

void

Inherited from

DataGrid.populateLock


populateUnlock()

protected populateUnlock(): void

Defined in: src/ui/datagrid/datagrid.tsx:1467

Unlocks the view population.

Returns

void

Inherited from

DataGrid.populateUnlock


populateWhenVisible()

protected populateWhenVisible(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:1098

Whether the grid should wait until visible before populating data.

Returns

boolean

True when population waits for visibility.

Inherited from

DataGrid.populateWhenVisible


postProcessColumns()

protected postProcessColumns(columns): Column<any>[]

Defined in: src/ui/datagrid/datagrid.tsx:564

Applies defaults and width adjustments to the given columns.

Parameters

columns

Column<any>[]

Columns to post-process.

Returns

Column<any>[]

The processed columns.

Inherited from

DataGrid.postProcessColumns


prepareSubmit()

prepareSubmit(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:1489

Prepares submit arguments in this.view.params by calling this.view.onSubmit if available, or this.handleViewSubmit if not. Note that if getGridCanLoad returns false, the prepared arguments might be in an incomplete state.

Returns

boolean

True when the submit should proceed.

Inherited from

DataGrid.prepareSubmit


propertyItemsReady()

protected propertyItemsReady(itemsData): void

Defined in: src/ui/datagrid/datagrid.tsx:198

Called once property items are available; creates the grid, filter bar, pager, quick filters, and restores persisted settings.

Parameters

itemsData

PropertyItemsData

Property items and additional items for the grid.

Returns

void

Inherited from

DataGrid.propertyItemsReady


propertyItemsToColumns()

protected propertyItemsToColumns(propertyItems): Column<any>[]

Defined in: src/ui/datagrid/datagrid.tsx:1428

Converts property items to grid columns, wrapping edit-link columns.

Parameters

propertyItems

PropertyItem[]

Property items to convert.

Returns

Column<any>[]

The grid columns.

Inherited from

DataGrid.propertyItemsToColumns


quickFilterChange()

protected quickFilterChange(e): void

Defined in: src/ui/datagrid/datagrid.tsx:1779

Handles quick filter changes by persisting settings and refreshing.

Parameters

e

Event

Change event.

Returns

void

Inherited from

DataGrid.quickFilterChange


refresh()

refresh(): void

Defined in: src/ui/datagrid/datagrid.tsx:1501

Refreshes the grid data, waiting for visibility if configured to do so.

Returns

void

Inherited from

DataGrid.refresh


refreshIfNeeded()

protected refreshIfNeeded(): void

Defined in: src/ui/datagrid/datagrid.tsx:1517

Refreshes the grid if a refresh was requested while hidden.

Returns

void

Inherited from

DataGrid.refreshIfNeeded


render()

render(): any

Defined in: src/ui/widgets/widget.ts:253

Returns the main element for this widget or the document fragment. As widgets may get their elements from props unlike regular JSX widgets, this method should not be overridden. Override renderContents() instead.

Returns

any

Inherited from

DataGrid.render


renderContents()

protected renderContents(): any

Defined in: src/ui/widgets/widget.ts:281

Renders the widget's contents. Override this to provide custom content.

Returns

any

The rendered contents.

Inherited from

DataGrid.renderContents


resizeCanvas()

protected resizeCanvas(): void

Defined in: src/ui/datagrid/datagrid.tsx:1658

Resizes the underlying grid canvas.

Returns

void

Inherited from

DataGrid.resizeCanvas


restoreSettings()

protected restoreSettings(settings?, flags?): void | Promise<void>

Defined in: src/ui/datagrid/datagrid.tsx:1851

Restores grid settings from the given settings or from storage.

Parameters

settings?

PersistedGridSettings

Optional settings to restore; defaults to persisted settings.

flags?

GridPersistenceFlags

Optional flags; storage restores show new visible columns and reset the layout on a revision mismatch unless restoreOptions say otherwise.

Returns

void | Promise<void>

Void or a promise that resolves when restoration completes.

Inherited from

DataGrid.restoreSettings


restoreSettingsFrom()

protected restoreSettingsFrom(settings, flags?): void

Defined in: src/ui/datagrid/datagrid.tsx:1887

Restores grid state from a persisted settings snapshot.

Parameters

settings

PersistedGridSettings

The settings to restore.

flags?

GridPersistenceFlags

Optional flags; direct restores keep the snapshot as is unless restoreOptions say otherwise.

Returns

void

Inherited from

DataGrid.restoreSettingsFrom


routeDialog()

protected routeDialog(itemType, dialog): void

Defined in: src/ui/datagrid/entitygrid.ts:420

Registers hash-based routing for the specified dialog.

Parameters

itemType

string

Entity type key for the dialog.

dialog

Widget<any>

Dialog widget to route.

Returns

void


rowCount()

rowCount(): number

Defined in: src/ui/datagrid/datagrid.tsx:741

Returns the number of rows in the grid.

Returns

number

The row count.

Inherited from

DataGrid.rowCount


set_readOnly()

set_readOnly(value): void

Defined in: src/ui/datagrid/datagrid.tsx:1561

Sets whether the grid is in read-only mode and updates the interface.

Parameters

value

boolean

True to enable read-only mode.

Returns

void

Inherited from

DataGrid.set_readOnly


setCriteriaParameter()

protected setCriteriaParameter(): void

Defined in: src/ui/datagrid/datagrid.tsx:988

Sets the Criteria view parameter from the active filter store criteria.

Returns

void

Inherited from

DataGrid.setCriteriaParameter


setEquality()

protected setEquality(field, value): void

Defined in: src/ui/datagrid/datagrid.tsx:1003

Sets an equality filter on the view parameters.

Parameters

field

string

Field name.

value

any

Equality value.

Returns

void

Inherited from

DataGrid.setEquality


setFilterBarVisibility()

protected setFilterBarVisibility(): void

Defined in: src/ui/datagrid/entitygrid.ts:238

Shows or hides the filter bar depending on whether active filters exist.

Returns

void


setGridStyle()

setGridStyle(style): void

Defined in: src/ui/datagrid/datagrid.tsx:305

Sets what the grid hides of the look its theme gives to grids, which a grid does at its creation from getInitialGridStyle. It adds or removes the slick-no-odd-even, slick-no-cell-border and slick-no-header-chrome classes of the grid's element, which set the --s-stripes, --s-cell-borders and --s-header-chrome variables to 0, so the theme decides for the others.

Parameters

style

GridStyle

The members of GridStyle to apply, combined, or null for the look of the theme. A number given as text, as an enum editor stores it, is accepted.

Returns

void

Inherited from

DataGrid.setGridStyle


setIncludeColumnsParameter()

protected setIncludeColumnsParameter(): void

Defined in: src/ui/datagrid/datagrid.tsx:1010

Sets the IncludeColumns view parameter from the grid columns.

Returns

void

Inherited from

DataGrid.setIncludeColumnsParameter


setInitialSortOrder()

protected setInitialSortOrder(): void

Defined in: src/ui/datagrid/datagrid.tsx:696

Applies the default sort order to the grid and view.

Returns

void

Inherited from

DataGrid.setInitialSortOrder


setItems()

setItems(value): void

Defined in: src/ui/datagrid/datagrid.tsx:757

Sets the items displayed in the grid.

Parameters

value

TItem[]

The items to display.

Returns

void

Inherited from

DataGrid.setItems


setTitle()

setTitle(value): void

Defined in: src/ui/datagrid/datagrid.tsx:1191

Sets the grid title text, creating or removing the title element as needed.

Parameters

value

RenderableContent

The title text, or null to remove the title.

Returns

void

Inherited from

DataGrid.setTitle


setViewParams()

protected setViewParams(): void

Defined in: src/ui/datagrid/datagrid.tsx:1023

Prepares all view parameters and notifies the onSetViewParams subscribers.

Returns

void

Inherited from

DataGrid.setViewParams


subDialogDataChange()

protected subDialogDataChange(): void

Defined in: src/ui/datagrid/datagrid.tsx:1665

Refreshes the grid when a sub-dialog reports a data change.

Returns

void

Inherited from

DataGrid.subDialogDataChange


syncOrAsyncThen()

protected syncOrAsyncThen<T>(syncMethod, asyncMethod, then): void

Defined in: src/ui/widgets/widget.ts:318

Runs a method synchronously or asynchronously depending on the widget's useAsync flag, then invokes a continuation.

Type Parameters

T

T

Parameters

syncMethod

() => T

The synchronous method to run.

asyncMethod

() => PromiseLike<T>

The asynchronous method to run.

then

(v) => void

The continuation invoked with the result.

Returns

void

Inherited from

DataGrid.syncOrAsyncThen


transferDialogReadOnly()

protected transferDialogReadOnly(dialog): void

Defined in: src/ui/datagrid/entitygrid.ts:517

Propagates the grid read-only state to a newly created dialog.

Parameters

dialog

Widget<any>

Dialog instance to configure.

Returns

void


tryFindQuickFilter()

protected tryFindQuickFilter<TWidget>(type, field): TWidget

Defined in: src/ui/datagrid/datagrid.tsx:450

Tries to find a quick filter widget by field name.

Type Parameters

TWidget

TWidget

Parameters

type

(...args) => TWidget

Widget constructor type.

field

string

Field name of the quick filter.

Returns

TWidget

The widget instance, or null if not found.

Inherited from

DataGrid.tryFindQuickFilter


updateInterface()

updateInterface(): void

Defined in: src/ui/datagrid/datagrid.tsx:1571

Updates the toolbar interface to reflect the current grid state.

Returns

void

Inherited from

DataGrid.updateInterface


useAsync()

protected useAsync(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:283

Whether the grid should load property items asynchronously.

Returns

boolean

True when async loading is used.

Inherited from

DataGrid.useAsync


useIdPrefix()

protected useIdPrefix(): IdPrefixType

Defined in: src/ui/widgets/widget.ts:329

Returns an id prefix helper for resolving child element ids.

Returns

IdPrefixType

An IdPrefixType proxy for this widget's id prefix.

Inherited from

DataGrid.useIdPrefix


useLayoutTimer()

protected useLayoutTimer(): boolean

Defined in: src/ui/datagrid/datagrid.tsx:323

Whether the grid should use the layout timer for responsive resizing.

Returns

boolean

True when the layout timer is used.

Inherited from

DataGrid.useLayoutTimer


usePager()

protected usePager(): boolean

Defined in: src/ui/datagrid/entitygrid.ts:103

Indicates whether a pager should be rendered; entity grids use a pager by default.

Returns

boolean

True when paging is enabled.

Overrides

DataGrid.usePager


viewDataChanged()

protected viewDataChanged(): void

Defined in: src/ui/datagrid/datagrid.tsx:892

Handles view data changes by notifying subscribers and relaying out.

Returns

void

Inherited from

DataGrid.viewDataChanged


protected wrapFormatterWithEditLink(column, item): void

Defined in: src/ui/datagrid/datagrid.tsx:1347

Wraps a column formatter with an edit link formatter.

Parameters

column

Column

Column to wrap.

item

PropertyItem

Property item describing the edit link.

Returns

void

Inherited from

DataGrid.wrapFormatterWithEditLink


create()

static create<TWidget, P>(params): TWidget

Defined in: src/ui/widgets/widget.ts:202

Creates a widget instance from the given params, appending its element to the container and invoking the init/init callbacks.

Type Parameters

TWidget

TWidget extends Widget<P>

P

P

Parameters

params

CreateWidgetParams<TWidget, P>

The widget creation params.

Returns

TWidget

The created widget instance.

Inherited from

DataGrid.create


createDefaultElement()

static createDefaultElement(): HTMLElement

Defined in: src/ui/widgets/widget.ts:75

Creates the default DOM element for a widget.

Returns

HTMLElement

A new div element.

Inherited from

DataGrid.createDefaultElement


getWidgetName()

static getWidgetName(type): string

Defined in: src/ui/widgets/widget.ts:131

Returns the widget name for a type, used for association and unique names.

Parameters

type

Function

The widget type.

Returns

string

The widget name.

Inherited from

DataGrid.getWidgetName


propertyItemToQuickFilter()

static propertyItemToQuickFilter(item): QuickFilter<any, any>

Defined in: src/ui/datagrid/datagrid.tsx:426

Converts a property item to a quick filter definition.

Parameters

item

PropertyItem

Property item to convert.

Returns

QuickFilter<any, any>

The quick filter definition, or null if not applicable.

Inherited from

DataGrid.propertyItemToQuickFilter


registerClass()

protected static registerClass<TypeName>(typeName, intfAndAttr?): ClassTypeInfo<TypeName>

Defined in: src/ui/widgets/widget.ts:342

Registers this type as a class with the given type name.

Type Parameters

TypeName

TypeName

Parameters

typeName

StringLiteral<TypeName>

The type name to register.

intfAndAttr?

(InterfaceType | AttributeSpecifier)[]

Optional interfaces and attributes.

Returns

ClassTypeInfo<TypeName>

The class type info.

Inherited from

DataGrid.registerClass


registerEditor()

protected static registerEditor<TypeName>(typeName, intfAndAttr?): EditorTypeInfo<TypeName>

Defined in: src/ui/widgets/widget.ts:357

Registers this type as an editor with the given type name.

Type Parameters

TypeName

TypeName

Parameters

typeName

StringLiteral<TypeName>

The type name to register.

intfAndAttr?

(InterfaceType | AttributeSpecifier)[]

Optional interfaces and attributes.

Returns

EditorTypeInfo<TypeName>

The editor type info.

Inherited from

DataGrid.registerEditor