@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
DataGrid<TItem,P>
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
Properties
domNode
readonlydomNode:HTMLElement
Defined in: src/ui/widgets/widget.ts:98
The DOM node this widget is bound to.
Inherited from
filterBar
protectedfilterBar:FilterDisplayBar
Defined in: src/ui/datagrid/datagrid.tsx:76
The advanced filter bar widget.
Inherited from
idPrefix
readonlyidPrefix:string
Defined in: src/ui/widgets/widget.ts:96
The id prefix used for this widget's child element ids.
Inherited from
onAfterInit
readonlyonAfterInit:PubSub<DataGridEvent>
Defined in: src/ui/datagrid/datagrid.tsx:132
Raised after this grid is initialized.
Inherited from
onCanSubmit
readonlyonCanSubmit:PubSub<DataGridSubmitEvent>
Defined in: src/ui/datagrid/datagrid.tsx:134
Raised to determine whether the grid can submit its view.
Inherited from
onDataChanged
readonlyonDataChanged:PubSub<DataGridEvent>
Defined in: src/ui/datagrid/datagrid.tsx:136
Raised when the grid data changes.
Inherited from
onFiltering
readonlyonFiltering:PubSub<DataGridFilteringEvent<TItem>>
Defined in: src/ui/datagrid/datagrid.tsx:138
Raised while filtering items in the view.
Inherited from
onPersistence
readonlyonPersistence:PubSub<DataGridPersistenceEvent>
Defined in: src/ui/datagrid/datagrid.tsx:140
Raised before/after persisting or restoring grid settings.
Inherited from
onProcessData
readonlyonProcessData:PubSub<DataGridProcessEvent<TItem>>
Defined in: src/ui/datagrid/datagrid.tsx:142
Raised when the view processes a list response.
Inherited from
onSetViewParams
readonlyonSetViewParams:PubSub<DataGridEvent>
Defined in: src/ui/datagrid/datagrid.tsx:146
Raised after view parameters are prepared for submission.
Inherited from
onSubmitting
readonlyonSubmitting:PubSub<DataGridSubmitEvent>
Defined in: src/ui/datagrid/datagrid.tsx:144
Raised to determine whether the view submit should proceed.
Inherited from
openDialogsAsPanel
openDialogsAsPanel:
boolean
Defined in: src/ui/datagrid/datagrid.tsx:91
Whether dialogs opened from this grid should be shown as panels.
Inherited from
options
protectedreadonlyoptions:WidgetProps<P>
Defined in: src/ui/widgets/widget.ts:92
The widget's options/props.
Inherited from
propertyItemsData
protectedpropertyItemsData:PropertyItemsData
Defined in: src/ui/datagrid/datagrid.tsx:84
The property items data for this grid.
Inherited from
quickFiltersBar
protectedquickFiltersBar:QuickFilterBar
Defined in: src/ui/datagrid/datagrid.tsx:80
The quick filter bar widget.
Inherited from
quickFiltersDiv
protectedquickFiltersDiv:Fluent
Defined in: src/ui/datagrid/datagrid.tsx:78
The quick filters container element.
Inherited from
restoringSettings
protectedrestoringSettings:number
Defined in: src/ui/datagrid/datagrid.tsx:86
Counter tracking nested settings restoration.
Inherited from
slickContainer
protectedslickContainer:Fluent
Defined in: src/ui/datagrid/datagrid.tsx:82
The container element that hosts the grid.
Inherited from
titleDiv
protectedtitleDiv:Fluent
Defined in: src/ui/datagrid/datagrid.tsx:72
The title element.
Inherited from
toolbar
protectedtoolbar:Toolbar
Defined in: src/ui/datagrid/datagrid.tsx:74
The toolbar widget.
Inherited from
uniqueName
readonlyuniqueName:string
Defined in: src/ui/widgets/widget.ts:94
A unique name for this widget instance, used for event namespacing.
Inherited from
view
view:
IRemoteView<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:88
The remote view used for paging and server communication.
Inherited from
[typeInfo]
static[typeInfo]:ClassTypeInfo<"Serenity.">
Defined in: src/ui/datagrid/entitygrid.ts:27
Overrides
defaultDeferInit
staticdefaultDeferInit:boolean=false
Defined in: src/ui/widgets/widget.ts:106
Whether the classes that neither have a DeferInitAttribute (see Attributes.deferInit) nor override
deferredInit, nor have a base class that says true or false, defer their initialization; false by
default. An application whose widgets are written for deferred
initialization turns it on in its script init, before any widget is created.
Inherited from
defaultOptions
readonlystaticdefaultOptions: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
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
isComponent
readonlystaticisComponent:true=true
Defined in: src/ui/widgets/widget.ts:530
Inherited from
onAfterInit
readonlystaticonAfterInit:PubSub<DataGridEvent>
Defined in: src/ui/datagrid/datagrid.tsx:130
Static event raised after any grid is initialized.
Inherited from
Accessors
allColumns
Get Signature
get allColumns():
Column<any>[]
Defined in: src/ui/datagrid/datagrid.tsx:2207
All columns including hidden ones.
Returns
Column<any>[]
All columns from the underlying SleekGrid.
Inherited from
columns
Get Signature
get columns():
Column<TItem>[]
Defined in: src/ui/datagrid/datagrid.tsx:2209
The currently visible columns.
Returns
Column<TItem>[]
Inherited from
element
Get Signature
get element():
Fluent
Defined in: src/ui/widgets/widget.ts:216
Returns a Fluent(this.domNode) object
Returns
Inherited from
initialized
Get Signature
get
protectedinitialized():boolean
Defined in: src/ui/widgets/widget.ts:137
Whether the widget is initialized: always for one that initializes in its constructor, and for one that defers its initialization (see isDeferredInit), once its deferredInit is done.
Returns
boolean
Inherited from
initialSettings
Get Signature
get initialSettings():
PersistedGridSettings
Defined in: src/ui/datagrid/datagrid.tsx:2211
The initial persisted settings captured at startup.
Returns
Set Signature
set initialSettings(
value):void
Defined in: src/ui/datagrid/datagrid.tsx:2213
Sets the initial persisted settings.
Parameters
value
Returns
void
Inherited from
props
Get Signature
get props():
WidgetProps<P>
Defined in: src/ui/widgets/widget.ts:503
Returns the widget's props/options.
Returns
WidgetProps<P>
Inherited from
readOnly
Get Signature
get readOnly():
boolean
Defined in: src/ui/datagrid/datagrid.tsx:1615
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:1623
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
rowSelector
Get Signature
get
protectedrowSelector():GridRowSelectionMixin
Defined in: src/ui/datagrid/datagrid.tsx:297
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
Inherited from
sleekGrid
Get Signature
get sleekGrid():
ISleekGrid<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:2174
The underlying SleekGrid instance.
Returns
ISleekGrid<TItem>
The current SleekGrid instance.
Set Signature
set sleekGrid(
value):void
Defined in: src/ui/datagrid/datagrid.tsx:2179
Sets the underlying SleekGrid instance.
Parameters
value
ISleekGrid<TItem>
SleekGrid instance to set.
Returns
void
Inherited from
slickGrid
Get Signature
get slickGrid():
ISleekGrid<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:2185
Deprecated
Use sleekGrid or getGrid().
Returns
ISleekGrid<TItem>
The underlying SleekGrid instance.
Inherited from
usesDeferredInit
Get Signature
get
protectedusesDeferredInit():boolean
Defined in: src/ui/widgets/widget.ts:129
Whether this widget defers its initialization, see isDeferredInit.
Returns
boolean
Inherited from
defaultColumnWidthDelta
Get Signature
get
staticdefaultColumnWidthDelta():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
staticdefaultColumnWidthDelta(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
staticdefaultColumnWidthScale():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
staticdefaultColumnWidthScale(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
staticdefaultPersistanceStorage():SettingStorage
Defined in: src/ui/datagrid/datagrid.tsx:2219
Deprecated
Use defaultPersistenceStorage — this has a typo.
Returns
The current persistence storage.
Set Signature
set
staticdefaultPersistanceStorage(value):void
Defined in: src/ui/datagrid/datagrid.tsx:2224
Deprecated
Use defaultPersistenceStorage — this has a typo.
Parameters
value
Persistence storage to set.
Returns
void
Inherited from
DataGrid.defaultPersistanceStorage
defaultPersistenceStorage
Get Signature
get
staticdefaultPersistenceStorage():SettingStorage
Defined in: src/ui/datagrid/datagrid.tsx:102
Default storage used for grid persistence.
Returns
The current persistence storage.
Set Signature
set
staticdefaultPersistenceStorage(value):void
Defined in: src/ui/datagrid/datagrid.tsx:107
Sets the default storage used for grid persistence.
Parameters
value
Persistence storage to use (e.g. localStorage-backed).
Returns
void
Inherited from
DataGrid.defaultPersistenceStorage
defaultRowHeight
Get Signature
get
staticdefaultRowHeight():number
Defined in: src/ui/datagrid/datagrid.tsx:97
Default row height used when creating grids.
Returns
number
Inherited from
Methods
addBooleanFilter()
protectedaddBooleanFilter(field,title?,yes?,no?):SelectEditor
Defined in: src/ui/datagrid/datagrid.tsx:1828
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
The created select editor.
Inherited from
addButtonClick()
protectedaddButtonClick():void
Defined in: src/ui/datagrid/entitygrid.ts:287
Handles the add button click by opening a new-item dialog.
Returns
void
addCssClass()
protectedaddCssClass():void
Defined in: src/ui/widgets/widget.ts:223
Adds the widget's CSS class to its DOM node.
Returns
void
Inherited from
addDateRangeFilter()
protectedaddDateRangeFilter(field,title?):DateEditor
Defined in: src/ui/datagrid/datagrid.tsx:1786
Adds a date range quick filter for the specified field.
Parameters
field
string
Field name.
title?
string
Optional display title.
Returns
The created date editor.
Inherited from
addDateTimeRangeFilter()
protectedaddDateTimeRangeFilter(field,title?):DateTimeEditor<DateTimeEditorOptions>
Defined in: src/ui/datagrid/datagrid.tsx:1806
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()
protectedaddFilterSeparator():void
Defined in: src/ui/datagrid/datagrid.tsx:1750
Adds a separator to the quick filter bar.
Returns
void
Inherited from
addQuickFilter()
protectedaddQuickFilter<TWidget,P>(opt):TWidget
Defined in: src/ui/datagrid/datagrid.tsx:1776
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
addValidationRule()
Call Signature
addValidationRule(
rule,uniqueName?):void
Defined in: src/ui/widgets/widget.ts:267
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
Call Signature
addValidationRule(
uniqueName,rule):void
Defined in: src/ui/widgets/widget.ts:268
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
afterInit()
protectedafterInit():void
Defined in: src/ui/datagrid/datagrid.tsx:322
Called once the columns, toolbar and quick filters of the grid are ready, before its settings are restored. In a
grid that initializes in its constructor, this is during the constructor of DataGrid, before the subclasses'
constructors and field initializers run. A grid that defers its initialization (see Widget.isDeferredInit) does
this work after await super.deferredInit() instead.
Returns
void
Inherited from
afterRender()
protectedafterRender(callback):void
Defined in: src/ui/widgets/widget.ts:359
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
autoRegisteringPlugin()
protectedautoRegisteringPlugin(args):void
Defined in: src/ui/datagrid/datagrid.tsx:213
Hook invoked when the grid is registered as an auto-registering plugin.
Parameters
args
Auto-registration arguments.
Returns
void
Inherited from
DataGrid.autoRegisteringPlugin
bindToSlickEvents()
protectedbindToSlickEvents():void
Defined in: src/ui/datagrid/datagrid.tsx:875
Subscribes to the underlying grid events.
Returns
void
Inherited from
bindToViewEvents()
protectedbindToViewEvents():void
Defined in: src/ui/datagrid/datagrid.tsx:966
Subscribes to view events for filtering, submitting, and processing data.
Returns
void
Inherited from
booleanQuickFilter()
protectedbooleanQuickFilter(field,title?,yes?,no?):QuickFilter<SelectEditor<SelectEditorOptions>,SelectEditorOptions>
Defined in: src/ui/datagrid/datagrid.tsx:1840
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
byId()
protectedbyId<TElement>(id):Fluent<TElement>
Defined in: src/ui/widgets/widget.ts:279
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
canFilterColumn()
protectedcanFilterColumn(column):boolean
Defined in: src/ui/datagrid/datagrid.tsx:689
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
change()
change(
handler):void
Defined in: src/ui/widgets/widget.ts:310
Registers a change handler on the widget's DOM node.
Parameters
handler
(e) => void
The change event handler.
Returns
void
Inherited from
changeSelect2()
changeSelect2(
handler):void
Defined in: src/ui/widgets/widget.ts:319
Registers a change handler that ignores changes originating from
combobox setting values.
Parameters
handler
(e) => void
The change event handler.
Returns
void
Inherited from
createColumns()
protectedcreateColumns():Column<TItem>[]
Defined in: src/ui/datagrid/datagrid.tsx:725
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
createEntityDialog()
protectedcreateEntityDialog(itemType,callback?):Widget<any> |PromiseLike<Widget<any>>
Defined in: src/ui/datagrid/entitygrid.ts:562
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()
protectedcreateFilterBar():void
Defined in: src/ui/datagrid/entitygrid.ts:253
Creates the filter bar and syncs its visibility.
Returns
void
Overrides
createIncludeDeletedButton()
protectedcreateIncludeDeletedButton():void
Defined in: src/ui/datagrid/entitygrid.ts:492
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()
protectedcreatePager():void
Defined in: src/ui/datagrid/datagrid.tsx:1200
Creates the pager widget for this grid.
Returns
void
Inherited from
createQuickFilters()
protectedcreateQuickFilters(filters?):void
Defined in: src/ui/datagrid/datagrid.tsx:448
Creates the quick filter bar with the given filters.
Parameters
filters?
QuickFilter<Widget<any>, any>[]
Quick filter definitions to render.
Returns
void
Inherited from
createQuickSearchInput()
protectedcreateQuickSearchInput():void
Defined in: src/ui/datagrid/datagrid.tsx:542
Creates the quick search input in the toolbar.
Returns
void
Inherited from
DataGrid.createQuickSearchInput
createSleekColumns()
protectedcreateSleekColumns():Column<TItem>[]
Defined in: src/ui/datagrid/datagrid.tsx:734
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
createSlickContainer()
protectedcreateSlickContainer():Fluent
Defined in: src/ui/datagrid/datagrid.tsx:1119
Creates the container element that hosts the grid.
Returns
The grid container element.
Inherited from
createSlickGrid()
protectedcreateSlickGrid():ISleekGrid<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:743
Creates the underlying SleekGrid instance with the processed columns.
Returns
ISleekGrid<TItem>
The created grid instance.
Inherited from
createToolbar()
protectedcreateToolbar(buttons):void
Defined in: src/ui/datagrid/datagrid.tsx:1230
Creates the toolbar with the given buttons.
Parameters
buttons
Tool button definitions.
Returns
void
Inherited from
createToolbarExtensions()
protectedcreateToolbarExtensions():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()
protectedcreateView():IRemoteView<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:1127
Creates the remote view used for paging and server communication.
Returns
IRemoteView<TItem>
The remote view instance.
Inherited from
dateRangeQuickFilter()
protecteddateRangeQuickFilter(field,title?):QuickFilter<DateEditor<DateEditorOptions>,DateTimeEditorOptions>
Defined in: src/ui/datagrid/datagrid.tsx:1796
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
dateTimeRangeQuickFilter()
protecteddateTimeRangeQuickFilter(field,title?):QuickFilter<DateTimeEditor<DateTimeEditorOptions>,DateTimeEditorOptions>
Defined in: src/ui/datagrid/datagrid.tsx:1816
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
deferredInit()
protecteddeferredInit():void|PromiseLike<void>
Defined in: src/ui/datagrid/datagrid.tsx:164
Initializes a grid that defers its initialization (see Widget.isDeferredInit): what the constructor does for the others, and then its columns, with the property items it loads asynchronously. The part before the property items runs at once, e.g. the toolbar and the view.
Returns
void | PromiseLike<void>
Inherited from
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
determineText()
protecteddetermineText(getKey):string
Defined in: src/ui/datagrid/datagrid.tsx:1759
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
editItem()
protectededitItem(entityOrId):void
Defined in: src/ui/datagrid/entitygrid.ts:295
Opens an edit dialog for an existing entity or a new instance.
Parameters
entityOrId
any
Entity instance or identifier to edit.
Returns
void
Overrides
editItemOfType()
protectededitItemOfType(itemType,entityOrId):void
Defined in: src/ui/datagrid/entitygrid.ts:348
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
EditLink()
EditLink(
props):any
Defined in: src/ui/datagrid/datagrid.tsx:1297
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
enableAdvancedFiltering()
protectedenableAdvancedFiltering():boolean
Defined in: src/ui/datagrid/datagrid.tsx:1157
Whether advanced filtering is enabled for this grid.
Returns
boolean
True when advanced filtering is enabled.
Inherited from
DataGrid.enableAdvancedFiltering
ensureQuickFilterBar()
protectedensureQuickFilterBar():QuickFilterBar
Defined in: src/ui/datagrid/datagrid.tsx:436
Ensures the quick filter bar exists and returns it.
Returns
The quick filter bar instance.
Inherited from
filterStoreChanged()
protectedfilterStoreChanged():void
Defined in: src/ui/datagrid/entitygrid.ts:261
Invoked when the filter store changes; refreshes the filter bar visibility.
Returns
void
Overrides
findById()
protectedfindById<TElement>(id):TElement
Defined in: src/ui/widgets/widget.ts:291
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
findQuickFilter()
protectedfindQuickFilter<TWidget>(type,field):TWidget
Defined in: src/ui/datagrid/datagrid.tsx:501
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
get_readOnly()
get_readOnly():
boolean
Defined in: src/ui/datagrid/datagrid.tsx:1631
Returns whether the grid is in read-only mode.
Returns
boolean
True when read-only.
Inherited from
getAddButtonCaption()
protectedgetAddButtonCaption():string
Defined in: src/ui/datagrid/entitygrid.ts:196
Returns the caption for the add/new button.
Returns
string
Localized add button text.
Overrides
getButtons()
protectedgetButtons():ToolButton[]
Defined in: src/ui/datagrid/entitygrid.ts:204
Builds the grid toolbar buttons including add, refresh, column picker and filter bar.
Returns
Array of tool button definitions.
Overrides
getColumns()
protectedgetColumns():Column<TItem>[]
Defined in: src/ui/datagrid/datagrid.tsx:1412
Returns
Column<TItem>[]
Deprecated
override createColumns
Inherited from
getColumnsKey()
protectedgetColumnsKey():string
Defined in: src/ui/datagrid/datagrid.tsx:1343
Returns the columns key used to load property items.
Returns
string
The columns key, or null for none.
Inherited from
getColumnsRevision()
protectedgetColumnsRevision():number
Defined in: src/ui/datagrid/datagrid.tsx:1351
Returns the columns revision used to detect incompatible persisted column layouts.
Returns
number
The columns revision number (0 means no revision).
Inherited from
getColumnWidthDelta()
protectedgetColumnWidthDelta():number
Defined in: src/ui/datagrid/datagrid.tsx:654
Returns the width delta applied to all columns.
Returns
number
The column width delta.
Inherited from
getColumnWidthScale()
protectedgetColumnWidthScale():number
Defined in: src/ui/datagrid/datagrid.tsx:662
Returns the width scale applied to all columns.
Returns
number
The column width scale.
Inherited from
getCssClass()
protectedgetCssClass():string
Defined in: src/ui/widgets/widget.ts:231
Returns the CSS class(es) applied to the widget's DOM node.
Returns
string
The space-separated CSS class string.
Inherited from
getCurrentSettings()
getCurrentSettings(
flags?):PersistedGridSettings
Defined in: src/ui/datagrid/datagrid.tsx:2121
Returns the current grid settings snapshot.
Parameters
flags?
Optional persistence flags.
Returns
The current grid settings.
Inherited from
getCustomAttribute()
protectedgetCustomAttribute<TAttr>(attrType,inherit):TAttr
Defined in: src/ui/widgets/widget.ts:351
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
getDefaultSortBy()
protectedgetDefaultSortBy():any[]
Defined in: src/ui/datagrid/datagrid.tsx:1141
Returns the default sort order for the grid.
Returns
any[]
Array of sort descriptors.
Inherited from
getDeletePermission()
protectedgetDeletePermission():string
Defined in: src/ui/datagrid/entitygrid.ts:458
Returns the permission key required to delete a row.
Returns
string
Delete permission or undefined.
getDialogOptions()
protectedgetDialogOptions():any
Defined in: src/ui/datagrid/entitygrid.ts:587
Returns default options for the primary entity dialog.
Returns
any
Dialog options.
getDialogOptionsFor()
protectedgetDialogOptionsFor(itemType):any
Defined in: src/ui/datagrid/entitygrid.ts:596
Returns dialog options for a specific item type.
Parameters
itemType
string
Entity type key.
Returns
any
Dialog options for that type.
getDialogType()
protectedgetDialogType():DialogType|PromiseLike<DialogType>
Defined in: src/ui/datagrid/entitygrid.ts:623
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()
protectedgetDialogTypeFor(itemType):DialogType|PromiseLike<DialogType>
Defined in: src/ui/datagrid/entitygrid.ts:608
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()
protectedgetDisplayName():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.
getEditLinks()
protectedgetEditLinks():"primary"|"all"
Defined in: src/ui/datagrid/datagrid.tsx:1452
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
getElement()
getElement():
HTMLElement
Defined in: src/ui/datagrid/datagrid.tsx:2158
Returns the root DOM element of the grid widget.
Returns
HTMLElement
The grid container element.
Inherited from
getEntityType()
protectedgetEntityType():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:2199
Returns the filter store owned by the grid.
Returns
The filter store, or null if no filter bar exists.
Inherited from
getGrid()
getGrid():
ISleekGrid<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:2166
Returns the underlying SleekGrid instance.
Returns
ISleekGrid<TItem>
The grid instance.
Inherited from
getGridCanLoad()
protectedgetGridCanLoad():boolean
Defined in: src/ui/datagrid/datagrid.tsx:1549
Determines whether the grid can load data, notifying onCanSubmit subscribers.
Returns
boolean
True when the grid can load.
Inherited from
getGridField()
getGridField():
Fluent
Defined in: src/ui/widgets/widget.ts:302
Returns the closest .field element containing the widget's DOM node.
Returns
A Fluent wrapper for the grid field.
Inherited from
getIdProperty()
protectedgetIdProperty():string
Defined in: src/ui/datagrid/datagrid.tsx:1697
Returns the id property name for this grid.
Returns
string
The id property name.
Inherited from
getIncludeColumns()
protectedgetIncludeColumns(include):void
Defined in: src/ui/datagrid/datagrid.tsx:1035
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
getInitialGridStyle()
protectedgetInitialGridStyle():GridStyle
Defined in: src/ui/datagrid/datagrid.tsx:341
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
The members of GridStyle to apply, combined, or null.
Inherited from
getInitialTitle()
protectedgetInitialTitle():RenderableContent
Defined in: src/ui/datagrid/entitygrid.ts:119
Returns the initial title for the grid panel.
Returns
Localized plural display name.
Overrides
getInsertPermission()
protectedgetInsertPermission():string
Defined in: src/ui/datagrid/entitygrid.ts:442
Returns the permission key required to insert a row.
Returns
string
Insert permission or undefined if none is configured.
getIsActiveProperty()
protectedgetIsActiveProperty():string
Defined in: src/ui/datagrid/datagrid.tsx:1722
Returns the is-active property name for this grid.
Returns
string
The is-active property name.
Inherited from
getIsDeletedProperty()
protectedgetIsDeletedProperty():string
Defined in: src/ui/datagrid/datagrid.tsx:1712
Returns the is-deleted property name for this grid.
Returns
string
The is-deleted property name, or undefined.
Inherited from
getItemCssClass()
protectedgetItemCssClass(item,index):string
Defined in: src/ui/datagrid/datagrid.tsx:606
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
getItemMetadata()
protectedgetItemMetadata(item,index):any
Defined in: src/ui/datagrid/datagrid.tsx:616
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
getItemName()
protectedgetItemName():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:814
Returns the items currently displayed in the grid.
Returns
TItem[]
The grid items.
Inherited from
getItemType()
protectedgetItemType():string
Defined in: src/ui/datagrid/entitygrid.ts:413
Returns the entity item type key used to resolve dialogs and row definitions.
Returns
string
Item type key.
Overrides
getLocalTextDbPrefix()
protectedgetLocalTextDbPrefix():string
Defined in: src/ui/datagrid/datagrid.tsx:1667
Returns the local text database prefix for this grid.
Returns
string
The local text db prefix.
Inherited from
getLocalTextPrefix()
protectedgetLocalTextPrefix():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
getPagerOptions()
protectedgetPagerOptions():PagerOptions
Defined in: src/ui/datagrid/datagrid.tsx:1189
Returns the pager options for this grid.
Returns
Pager options.
Inherited from
getPersistedSettings()
protectedgetPersistedSettings():PersistedGridSettings|Promise<PersistedGridSettings>
Defined in: src/ui/datagrid/datagrid.tsx:1904
Retrieves the persisted grid settings from storage.
Returns
PersistedGridSettings | Promise<PersistedGridSettings>
The persisted settings, or a promise resolving to them.
Inherited from
getPersistenceKey()
protectedgetPersistenceKey():string
Defined in: src/ui/datagrid/datagrid.tsx:1877
Returns the key used to store grid settings.
Returns
string
The persistence key.
Inherited from
getPersistenceStorage()
protectedgetPersistenceStorage():SettingStorage
Defined in: src/ui/datagrid/datagrid.tsx:1867
Returns the storage used for grid persistence.
Returns
The persistence storage.
Inherited from
DataGrid.getPersistenceStorage
getPrimaryEditLinkColumn()
protectedgetPrimaryEditLinkColumn(columns):Column
Defined in: src/ui/datagrid/datagrid.tsx:1466
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()
protectedgetPropertyItems():PropertyItem[]
Defined in: src/ui/datagrid/datagrid.tsx:1359
Returns the property items for this grid.
Returns
The property items.
Inherited from
getPropertyItemsData()
protectedgetPropertyItemsData():PropertyItemsData
Defined in: src/ui/datagrid/datagrid.tsx:1367
Loads the property items data, either from script data or local items.
Returns
The property items data.
Inherited from
getPropertyItemsDataAsync()
protectedgetPropertyItemsDataAsync():Promise<PropertyItemsData>
Defined in: src/ui/datagrid/datagrid.tsx:1393
Asynchronously loads the property items data, which a grid that defers its initialization uses. A subclass that gives its items by overriding only the sync getPropertyItemsData, or getPropertyItems without a script to load, gets them here too, as the sync loader would.
Returns
Promise<PropertyItemsData>
A promise resolving to the property items data.
Inherited from
DataGrid.getPropertyItemsDataAsync
getQuickFilters()
protectedgetQuickFilters():QuickFilter<Widget<any>,any>[]
Defined in: src/ui/datagrid/datagrid.tsx:476
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
getQuickSearchFields()
protectedgetQuickSearchFields():QuickSearchField[]
Defined in: src/ui/datagrid/datagrid.tsx:535
Returns the quick search fields available for this grid.
Returns
The quick search fields, or null for none.
Inherited from
getRecordViews()
getRecordViews():
RecordViewInfo[]
Defined in: src/ui/datagrid/datagrid.tsx:286
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
The record views, an empty list when there are none.
Inherited from
getRowDefinition()
protectedgetRowDefinition():IRowDefinition
Defined in: src/ui/datagrid/datagrid.tsx:1657
Returns the row definition for this grid.
Returns
The row definition, or null for none.
Inherited from
getService()
protectedgetService():string
Defined in: src/ui/datagrid/entitygrid.ts:376
Returns the service endpoint path for the entity (e.g. "Administration/User").
Returns
string
Service path derived from the entity type.
getServiceMethod()
protectedgetServiceMethod():string
Defined in: src/ui/datagrid/entitygrid.ts:387
Returns the service method name for listing entities.
Returns
string
Service method (defaults to "
getServiceUrl()
protectedgetServiceUrl():string
Defined in: src/ui/datagrid/entitygrid.ts:395
Returns the absolute URL for the list service endpoint.
Returns
string
Resolved service URL.
getSlickOptions()
protectedgetSlickOptions():GridOptions
Defined in: src/ui/datagrid/datagrid.tsx:1517
Returns the SleekGrid options for this grid.
Returns
GridOptions
Grid options.
Inherited from
getTitle()
getTitle():
string
Defined in: src/ui/datagrid/datagrid.tsx:1242
Returns the current grid title text.
Returns
string
The title text, or null if no title is set.
Inherited from
getUndeletePermission()
protectedgetUndeletePermission():string
Defined in: src/ui/datagrid/entitygrid.ts:475
Returns the permission key required to undelete a row.
Returns
string
Undelete permission or undefined.
getUpdatePermission()
protectedgetUpdatePermission():string
Defined in: src/ui/datagrid/entitygrid.ts:450
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:2191
Returns the remote view used for paging and server communication.
Returns
IRemoteView<TItem>
The remote view instance.
Inherited from
getViewOptions()
protectedgetViewOptions():RemoteViewOptions
Defined in: src/ui/datagrid/entitygrid.ts:403
Returns view options including the service URL.
Returns
Remote view options with URL populated.
Overrides
gridPersistenceFlags()
protectedgridPersistenceFlags():GridPersistenceFlags
Defined in: src/ui/datagrid/datagrid.tsx:1894
Returns the default persistence flags for this grid. Restore options apply to automatic storage restores.
Returns
Grid persistence flags.
Inherited from
handleGridClick()
protectedhandleGridClick(e):void
Defined in: src/ui/datagrid/datagrid.tsx:839
Handles grid cell click events by delegating to onClick.
Parameters
e
CellMouseEvent
Cell mouse event.
Returns
void
Inherited from
handleGridColumnsReordered()
protectedhandleGridColumnsReordered():void
Defined in: src/ui/datagrid/datagrid.tsx:854
Persists settings when columns are reordered.
Returns
void
Inherited from
DataGrid.handleGridColumnsReordered
handleGridColumnsResized()
protectedhandleGridColumnsResized():void
Defined in: src/ui/datagrid/datagrid.tsx:861
Persists settings when columns are resized.
Returns
void
Inherited from
DataGrid.handleGridColumnsResized
handleGridKeyDown()
protectedhandleGridKeyDown(e):void
Defined in: src/ui/datagrid/datagrid.tsx:847
Handles grid key down events by delegating to onKeyDown.
Parameters
e
CellKeyboardEvent
Cell keyboard event.
Returns
void
Inherited from
handleGridSort()
protectedhandleGridSort(e):void
Defined in: src/ui/datagrid/datagrid.tsx:830
Handles grid sort events by applying the sort and persisting settings.
Parameters
e
GridSortEvent
Grid sort event.
Returns
void
Inherited from
handleRoute()
protectedhandleRoute(e):void
Defined in: src/ui/datagrid/entitygrid.ts:51
Handles hash-based routing for new/edit dialog invocations.
Parameters
e
Route event containing the hash fragment and navigation metadata.
Returns
void
handleViewFilter()
protectedhandleViewFilter(item):boolean
Defined in: src/ui/datagrid/datagrid.tsx:979
Filters a view item, notifying the onFiltering subscribers.
Parameters
item
TItem
The item to filter.
Returns
boolean
True when the item matches.
Inherited from
handleViewProcessData()
protectedhandleViewProcessData(response):ListResponse<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:993
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()
protectedhandleViewSubmit():boolean
Defined in: src/ui/datagrid/datagrid.tsx:1004
Handles view submission, notifying the onSubmitting subscribers.
Returns
boolean
True when the submit should proceed.
Inherited from
hasDeletePermission()
protectedhasDeletePermission():boolean
Defined in: src/ui/datagrid/entitygrid.ts:466
Checks whether the current user may delete rows.
Returns
boolean
True when deletion is allowed.
hasInsertPermission()
protectedhasInsertPermission():boolean
Defined in: src/ui/datagrid/entitygrid.ts:501
Checks whether the current user may insert rows.
Returns
boolean
True when insertion is allowed.
hasUndeletePermission()
protectedhasUndeletePermission():boolean
Defined in: src/ui/datagrid/entitygrid.ts:483
Checks whether the current user may undelete rows.
Returns
boolean
True when undeletion is allowed.
hasUpdatePermission()
protectedhasUpdatePermission():boolean
Defined in: src/ui/datagrid/entitygrid.ts:510
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:375
Initializes the widget: one that defers its initialization (see isDeferredInit) starts it, and it may end later, see initAsync; others are initialized by their constructors already.
Returns
this
This widget instance.
Inherited from
initAsync()
initAsync():
Promise<EntityGrid<TItem,P>>
Defined in: src/ui/widgets/widget.ts:388
Initializes the widget once and waits until it is initialized: one that defers its initialization (see isDeferredInit) runs its deferredInit, the first time it is called; others are initialized by their constructors.
Returns
Promise<EntityGrid<TItem, P>>
A promise of this widget, which is rejected when its initialization fails.
Inherited from
initDialog()
protectedinitDialog(dialog):void
Defined in: src/ui/datagrid/entitygrid.ts:528
Initializes a dialog bound to the primary item type.
Parameters
dialog
Widget<any>
Dialog instance to initialize.
Returns
void
initEntityDialog()
protectedinitEntityDialog(itemType,dialog):void
Defined in: src/ui/datagrid/entitygrid.ts:542
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()
protectedinitializeFilterBar():void
Defined in: src/ui/datagrid/datagrid.tsx:699
Initializes the filter bar store with the filterable columns.
Returns
void
Inherited from
initialPopulate()
protectedinitialPopulate():void
Defined in: src/ui/datagrid/datagrid.tsx:669
Performs the initial data population, optionally waiting until visible.
Returns
void
Inherited from
initNow()
protectedinitNow():boolean
Defined in: src/ui/widgets/widget.ts:146
Starts the initialization of a widget that defers it, if it hasn't started, and tells whether it is
initialized now, e.g. as it had nothing to wait for. A method that needs the widget initialized waits for
initAsync when it is not, e.g. if (!this.initNow()) return void this.initAsync().then(...).
Returns
boolean
Inherited from
initRowSelector()
protectedinitRowSelector():void
Defined in: src/ui/datagrid/datagrid.tsx:307
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
initSleekGrid()
protectedinitSleekGrid():void
Defined in: src/ui/datagrid/datagrid.tsx:755
Hook for subclasses to initialize the grid after creation.
Returns
void
Inherited from
internalRefresh()
protectedinternalRefresh():void
Defined in: src/ui/datagrid/datagrid.tsx:1605
Performs the actual data refresh by populating the view.
Returns
void
Inherited from
internalRenderContents()
internalRenderContents():
void
Defined in: src/ui/widgets/widget.ts:462
Renders the widget's contents and runs any queued after-render callbacks.
Returns
void
Inherited from
DataGrid.internalRenderContents
invokeSubmitHandlers()
protectedinvokeSubmitHandlers():void
Defined in: src/ui/datagrid/datagrid.tsx:1847
Invokes the quick filter submit handlers with the current view params.
Returns
void
Inherited from
isQuietEditLinkColumn()
protectedisQuietEditLinkColumn(column):boolean
Defined in: src/ui/datagrid/datagrid.tsx:1475
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:789
Returns the item at the given row index.
Parameters
row
number
Row index.
Returns
TItem
The item at that row.
Inherited from
itemId()
itemId(
item):any
Defined in: src/ui/datagrid/datagrid.tsx:798
Returns the id of the given item using the grid id property.
Parameters
item
TItem
The item.
Returns
any
The item id.
Inherited from
itemLink()
protecteditemLink(itemType?,idField?,text?,cssClass?,encode?):Format<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:1291
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
layout()
protectedlayout():void
Defined in: src/ui/datagrid/datagrid.tsx:391
Recalculates the grid layout, handling responsive height behavior. On a screen narrower than 768 pixels, a grid
that useNarrowAutoHeight says so is as high as its rows, unless its view can't be, i.e. one that has a row
for each row of the server and loads the ones in the viewport, which says so with a supportsAutoHeight property
that is false, as all its rows would be in view and loaded. Such a grid gets the s-narrow-fixed-height class
instead, which gives it a height of its own, so it scrolls.
Returns
void
Inherited from
legacyTemplateRender()
protectedlegacyTemplateRender():boolean
Defined in: src/ui/widgets/widget.ts:487
Renders the widget from a legacy getTemplate string, if defined.
Returns
boolean
True if a legacy template was rendered.
Inherited from
markupReady()
protectedmarkupReady():void
Defined in: src/ui/datagrid/datagrid.tsx:1111
Hook invoked when the grid markup is ready after data changes.
Returns
void
Inherited from
newRefreshButton()
protectednewRefreshButton(noText?):ToolButton
Defined in: src/ui/datagrid/entitygrid.ts:271
Creates a refresh toolbar button.
Parameters
noText?
boolean
When true, only an icon with a hint is shown.
Returns
Tool button definition for refreshing the grid.
onClick()
protectedonClick(e,row,cell):void
Defined in: src/ui/datagrid/datagrid.tsx:928
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
onKeyDown()
protectedonKeyDown(e,row,cell):void
Defined in: src/ui/datagrid/entitygrid.ts:320
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
onViewFilter()
protectedonViewFilter(item):boolean
Defined in: src/ui/datagrid/datagrid.tsx:1027
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
onViewProcessData()
protectedonViewProcessData(response):ListResponse<TItem>
Defined in: src/ui/datagrid/datagrid.tsx:1018
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
onViewSubmit()
protectedonViewSubmit():boolean
Defined in: src/ui/datagrid/datagrid.tsx:1099
Hook invoked before the view submits; prepares parameters and checks loadability.
Returns
boolean
True when the view can load.
Inherited from
persistenceLock()
persistenceLock():
void
Defined in: src/ui/datagrid/datagrid.tsx:2056
Increments the persistence lock, preventing settings from being persisted.
Returns
void
Inherited from
persistenceUnlock()
persistenceUnlock():
void
Defined in: src/ui/datagrid/datagrid.tsx:2063
Decrements the persistence lock.
Returns
void
Inherited from
persistSettings()
persistSettings(
flags?):void|Promise<void>
Defined in: src/ui/datagrid/datagrid.tsx:2072
Persists the current grid settings to storage.
Parameters
flags?
Optional persistence flags.
Returns
void | Promise<void>
Void or a promise that resolves when the write completes.
Inherited from
populateLock()
protectedpopulateLock():void
Defined in: src/ui/datagrid/datagrid.tsx:1534
Locks the view against population.
Returns
void
Inherited from
populateUnlock()
protectedpopulateUnlock():void
Defined in: src/ui/datagrid/datagrid.tsx:1541
Unlocks the view population.
Returns
void
Inherited from
populateWhenVisible()
protectedpopulateWhenVisible():boolean
Defined in: src/ui/datagrid/datagrid.tsx:1168
Whether the grid should wait until visible before populating data.
Returns
boolean
True when population waits for visibility.
Inherited from
postProcessColumns()
protectedpostProcessColumns(columns):Column<any>[]
Defined in: src/ui/datagrid/datagrid.tsx:629
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
prepareSubmit()
prepareSubmit():
boolean
Defined in: src/ui/datagrid/datagrid.tsx:1563
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
propertyItemsReady()
protectedpropertyItemsReady(itemsData):void|PromiseLike<void>
Defined in: src/ui/datagrid/datagrid.tsx:227
Called once property items are available; creates the grid, filter bar, pager, quick filters, and restores persisted settings.
Parameters
itemsData
Property items and additional items for the grid.
Returns
void | PromiseLike<void>
Inherited from
propertyItemsToColumns()
protectedpropertyItemsToColumns(propertyItems):Column<any>[]
Defined in: src/ui/datagrid/datagrid.tsx:1502
Converts property items to grid columns, wrapping edit-link columns.
Parameters
propertyItems
Property items to convert.
Returns
Column<any>[]
The grid columns.
Inherited from
DataGrid.propertyItemsToColumns
quickFilterChange()
protectedquickFilterChange(e):void
Defined in: src/ui/datagrid/datagrid.tsx:1857
Handles quick filter changes by persisting settings and refreshing.
Parameters
e
Event
Change event.
Returns
void
Inherited from
refresh()
refresh():
void
Defined in: src/ui/datagrid/datagrid.tsx:1575
Refreshes the grid data, waiting for visibility if configured to do so.
Returns
void
Inherited from
refreshIfNeeded()
protectedrefreshIfNeeded():void
Defined in: src/ui/datagrid/datagrid.tsx:1595
Refreshes the grid if a refresh was requested while hidden.
Returns
void
Inherited from
render()
render():
any
Defined in: src/ui/widgets/widget.ts:449
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
renderContents()
protectedrenderContents():any
Defined in: src/ui/widgets/widget.ts:477
Renders the widget's contents. Override this to provide custom content.
Returns
any
The rendered contents.
Inherited from
resetSettings()
resetSettings():
void|Promise<void>
Defined in: src/ui/datagrid/datagrid.tsx:2091
Resets the grid to its initial settings, the ones it had before its saved settings were restored, e.g. its columns, their widths, the sorting, the quick filters with their initial values, the filters and the quick search, and deletes its saved settings, so that they are not restored the next time, and loads its rows again.
Returns
void | Promise<void>
Void or a promise that resolves when the saved settings are deleted.
Inherited from
resizeCanvas()
protectedresizeCanvas():void
Defined in: src/ui/datagrid/datagrid.tsx:1736
Resizes the underlying grid canvas.
Returns
void
Inherited from
restoreSettings()
protectedrestoreSettings(settings?,flags?):void|Promise<void>
Defined in: src/ui/datagrid/datagrid.tsx:1929
Restores grid settings from the given settings or from storage.
Parameters
settings?
Optional settings to restore; defaults to persisted settings.
flags?
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
restoreSettingsFrom()
protectedrestoreSettingsFrom(settings,flags?):void
Defined in: src/ui/datagrid/datagrid.tsx:1965
Restores grid state from a persisted settings snapshot.
Parameters
settings
The settings to restore.
flags?
Optional flags; direct restores keep the snapshot as is unless restoreOptions say otherwise.
Returns
void
Inherited from
routeDialog()
protectedrouteDialog(itemType,dialog):void
Defined in: src/ui/datagrid/entitygrid.ts:422
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:806
Returns the number of rows in the grid.
Returns
number
The row count.
Inherited from
set_readOnly()
set_readOnly(
value):void
Defined in: src/ui/datagrid/datagrid.tsx:1639
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
setCriteriaParameter()
protectedsetCriteriaParameter():void
Defined in: src/ui/datagrid/datagrid.tsx:1053
Sets the Criteria view parameter from the active filter store criteria.
Returns
void
Inherited from
setEquality()
protectedsetEquality(field,value):void
Defined in: src/ui/datagrid/datagrid.tsx:1068
Sets an equality filter on the view parameters.
Parameters
field
string
Field name.
value
any
Equality value.
Returns
void
Inherited from
setFilterBarVisibility()
protectedsetFilterBarVisibility():void
Defined in: src/ui/datagrid/entitygrid.ts:240
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:353
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
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
setIncludeColumnsParameter()
protectedsetIncludeColumnsParameter():void
Defined in: src/ui/datagrid/datagrid.tsx:1075
Sets the IncludeColumns view parameter from the grid columns.
Returns
void
Inherited from
DataGrid.setIncludeColumnsParameter
setInitialSortOrder()
protectedsetInitialSortOrder():void
Defined in: src/ui/datagrid/datagrid.tsx:761
Applies the default sort order to the grid and view.
Returns
void
Inherited from
setItems()
setItems(
value):void
Defined in: src/ui/datagrid/datagrid.tsx:822
Sets the items displayed in the grid.
Parameters
value
TItem[]
The items to display.
Returns
void
Inherited from
setTitle()
setTitle(
value):void
Defined in: src/ui/datagrid/datagrid.tsx:1254
Sets the grid title text, creating or removing the title element as needed.
Parameters
value
The title text, or null to remove the title.
Returns
void
Inherited from
setViewParams()
protectedsetViewParams():void
Defined in: src/ui/datagrid/datagrid.tsx:1088
Prepares all view parameters and notifies the onSetViewParams subscribers.
Returns
void
Inherited from
subDialogDataChange()
protectedsubDialogDataChange():void
Defined in: src/ui/datagrid/datagrid.tsx:1743
Refreshes the grid when a sub-dialog reports a data change.
Returns
void
Inherited from
syncOrAsyncThen()
protectedsyncOrAsyncThen<T>(syncMethod,asyncMethod,then):void
Defined in: src/ui/widgets/widget.ts:514
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
transferDialogReadOnly()
protectedtransferDialogReadOnly(dialog):void
Defined in: src/ui/datagrid/entitygrid.ts:519
Propagates the grid read-only state to a newly created dialog.
Parameters
dialog
Widget<any>
Dialog instance to configure.
Returns
void
tryFindQuickFilter()
protectedtryFindQuickFilter<TWidget>(type,field):TWidget
Defined in: src/ui/datagrid/datagrid.tsx:515
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
updateInterface()
updateInterface():
void
Defined in: src/ui/datagrid/datagrid.tsx:1649
Updates the toolbar interface to reflect the current grid state.
Returns
void
Inherited from
useAsync()
protecteduseAsync():boolean
Defined in: src/ui/datagrid/datagrid.tsx:331
Whether the grid should load property items asynchronously.
Returns
boolean
True when async loading is used; false by default.
Deprecated
Defer the initialization instead, see Widget.isDeferredInit, which loads them asynchronously and waits for them.
Inherited from
useIdPrefix()
protecteduseIdPrefix():IdPrefixType
Defined in: src/ui/widgets/widget.ts:525
Returns an id prefix helper for resolving child element ids.
Returns
An IdPrefixType proxy for this widget's id prefix.
Inherited from
useLayoutTimer()
protecteduseLayoutTimer():boolean
Defined in: src/ui/datagrid/datagrid.tsx:371
Whether the grid should use the layout timer for responsive resizing.
Returns
boolean
True when the layout timer is used.
Inherited from
useNarrowAutoHeight()
protecteduseNarrowAutoHeight():boolean
Defined in: src/ui/datagrid/datagrid.tsx:380
Whether the grid is as high as its rows on a narrow screen, so the page scrolls instead of the grid, which a grid
with the responsive-height class is, e.g. of a full height grid page. See layout.
Returns
boolean
True for the auto height on a narrow screen.
Inherited from
usePager()
protectedusePager():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
viewDataChanged()
protectedviewDataChanged():void
Defined in: src/ui/datagrid/datagrid.tsx:957
Handles view data changes by notifying subscribers and relaying out.
Returns
void
Inherited from
wrapFormatterWithEditLink()
protectedwrapFormatterWithEditLink(column,item):void
Defined in: src/ui/datagrid/datagrid.tsx:1421
Wraps a column formatter with an edit link formatter.
Parameters
column
Column
Column to wrap.
item
Property item describing the edit link.
Returns
void
Inherited from
DataGrid.wrapFormatterWithEditLink
create()
staticcreate<TWidget,P>(params):TWidget
Defined in: src/ui/widgets/widget.ts:333
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
createDefaultElement()
staticcreateDefaultElement():HTMLElement
Defined in: src/ui/widgets/widget.ts:209
Creates the default DOM element for a widget.
Returns
HTMLElement
A new div element.
Inherited from
getWidgetName()
staticgetWidgetName(type):string
Defined in: src/ui/widgets/widget.ts:256
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
isDeferredInit()
staticisDeferredInit(type,requested?):boolean
Defined in: src/ui/widgets/widget.ts:118
Gets whether a widget of a type defers its initialization to deferredInit, which init or
initAsync runs once all the constructors are done, and which may wait. It is as the DeferInitAttribute
(see Attributes.deferInit) of the type or a base class says, true for a class that overrides
deferredInit, else as defaultDeferInit says. It throws when the type and its base classes say
conflicting things, e.g. a class has false but overrides deferredInit.
Parameters
type
Function
The widget type.
requested?
boolean
Whether the creator of the widget asks for it, see WidgetProps.deferInit, which counts
only for a class whose own attribute says "optional".
Returns
boolean
Inherited from
propertyItemToQuickFilter()
staticpropertyItemToQuickFilter(item):QuickFilter<any,any>
Defined in: src/ui/datagrid/datagrid.tsx:491
Converts a property item to a quick filter definition.
Parameters
item
Property item to convert.
Returns
QuickFilter<any, any>
The quick filter definition, or null if not applicable.
Inherited from
DataGrid.propertyItemToQuickFilter
registerClass()
protectedstaticregisterClass<TypeName>(typeName,intfAndAttr?):ClassTypeInfo<TypeName>
Defined in: src/ui/widgets/widget.ts:538
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
registerEditor()
protectedstaticregisterEditor<TypeName>(typeName,intfAndAttr?):EditorTypeInfo<TypeName>
Defined in: src/ui/widgets/widget.ts:553
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.