@serenity-is/corelib / EntityDialog
Class: EntityDialog<TItem, P>
Defined in: src/ui/dialogs/entitydialog.tsx:36
Base dialog for editing entities, integrating property grids, save/delete operations, localization, and toolbar buttons.
Extends
BaseDialog<P>
Type Parameters
TItem
TItem
Entity row type.
P
P = { }
Widget props type.
Implements
Constructors
Constructor
new EntityDialog<
TItem,P>(props?):EntityDialog<TItem,P>
Defined in: src/ui/dialogs/entitydialog.tsx:67
Creates an entity dialog and loads property items.
Parameters
props?
WidgetProps<P>
Widget props forwarded to the base dialog.
Returns
EntityDialog<TItem, P>
Overrides
Properties
applyChangesButton
protectedapplyChangesButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:46
cloneButton
protectedcloneButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:49
deleteButton
protecteddeleteButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:47
dialog
protecteddialog:Dialog
Defined in: src/ui/dialogs/basedialog.tsx:27
Inherited from
domNode
readonlydomNode:HTMLElement
Defined in: src/ui/widgets/widget.ts:98
The DOM node this widget is bound to.
Inherited from
editButton
protectededitButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:50
editClicked
protectededitClicked:boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1275
idPrefix
readonlyidPrefix:string
Defined in: src/ui/widgets/widget.ts:96
The id prefix used for this widget's child element ids.
Inherited from
localizer
protectedlocalizer:EntityLocalizer
Defined in: src/ui/dialogs/entitydialog.tsx:52
localizerButton
protectedlocalizerButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:53
onAfterInit
readonlyonAfterInit:PubSub<DialogEvent>
Defined in: src/ui/dialogs/basedialog.tsx:35
Raised after this dialog is initialized.
Inherited from
onAfterLoadEntity
readonlyonAfterLoadEntity:PubSub<EntityDialogEvent>
Defined in: src/ui/dialogs/entitydialog.tsx:61
Raised after this dialog loads an entity.
options
protectedreadonlyoptions:WidgetProps<P>
Defined in: src/ui/widgets/widget.ts:92
The widget's options/props.
Inherited from
propertyGrid
protectedpropertyGrid:PropertyGrid
Defined in: src/ui/dialogs/entitydialog.tsx:43
propertyItemsData
protectedpropertyItemsData:PropertyItemsData
Defined in: src/ui/dialogs/entitydialog.tsx:42
saveAndCloseButton
protectedsaveAndCloseButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:45
tabs
protectedtabs:Fluent<HTMLElement>
Defined in: src/ui/dialogs/basedialog.tsx:24
Inherited from
toolbar
protectedtoolbar:Toolbar
Defined in: src/ui/dialogs/basedialog.tsx:25
Inherited from
undeleteButton
protectedundeleteButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:48
uniqueName
readonlyuniqueName:string
Defined in: src/ui/widgets/widget.ts:94
A unique name for this widget instance, used for event namespacing.
Inherited from
validator
protectedvalidator:any
Defined in: src/ui/dialogs/basedialog.tsx:26
Inherited from
[typeInfo]
static[typeInfo]:ClassTypeInfo<"Serenity.">
Defined in: src/ui/dialogs/entitydialog.tsx:37
Implementation of
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
isComponent
readonlystaticisComponent:true=true
Defined in: src/ui/widgets/widget.ts:530
Inherited from
onAfterInit
readonlystaticonAfterInit:PubSub<DialogEvent>
Defined in: src/ui/dialogs/basedialog.tsx:33
Static event raised after any dialog is initialized, e.g. when the form, the tabs and the toolbar of an entity dialog are there, for a feature that adds a tab or a button to some dialogs, e.g. a help or an assistant.
Inherited from
onAfterLoadEntity
readonlystaticonAfterLoadEntity:PubSub<EntityDialogEvent>
Defined in: src/ui/dialogs/entitydialog.tsx:59
Static event raised after any entity dialog loads an entity, a new one or one by its id, once the dialog has updated its interface for it.
Accessors
dialogTitle
Get Signature
get dialogTitle():
string
Defined in: src/ui/dialogs/basedialog.tsx:364
Returns the current dialog title.
Returns
string
The dialog title.
Set Signature
set dialogTitle(
value):void
Defined in: src/ui/dialogs/basedialog.tsx:369
Sets the dialog title.
Parameters
value
string
Returns
void
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
entity
Get Signature
get entity():
TItem
Defined in: src/ui/dialogs/entitydialog.tsx:160
Returns the current entity.
Returns
TItem
The entity.
Set Signature
set entity(
value):void
Defined in: src/ui/dialogs/entitydialog.tsx:165
Sets the current entity.
Parameters
value
TItem
Returns
void
entityId
Get Signature
get entityId():
any
Defined in: src/ui/dialogs/entitydialog.tsx:178
Returns the current entity id.
Returns
any
The entity id.
Set Signature
set entityId(
value):void
Defined in: src/ui/dialogs/entitydialog.tsx:183
Sets the current entity id.
Parameters
value
any
Returns
void
entityType
Get Signature
get entityType():
string
Defined in: src/ui/dialogs/entitydialog.tsx:107
The entity type of the dialog, e.g. "Northwind.Order", which is the class name of the dialog without its root namespace and "Dialog" suffix, unless the dialog gives another one.
Returns
string
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
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/dialogs/entitydialog.tsx:1166
Whether the dialog is in read-only mode.
Returns
boolean
Set Signature
set readOnly(
value):void
Defined in: src/ui/dialogs/entitydialog.tsx:1171
Sets whether the dialog is in read-only mode.
Parameters
value
boolean
Returns
void
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
defaultLanguageList
Get Signature
get
staticdefaultLanguageList():string[][]
Defined in: src/ui/dialogs/entitydialog.tsx:1316
Returns the default language list for localization.
Returns
string[][]
The default language list.
Set Signature
set
staticdefaultLanguageList(value):void
Defined in: src/ui/dialogs/entitydialog.tsx:1321
Sets the default language list for localization.
Parameters
value
string[][]
Returns
void
Methods
addCssClass()
protectedaddCssClass():void
Defined in: src/ui/dialogs/basedialog.tsx:124
Hook for subclasses to add CSS classes; the class goes to the dialog/modal/panel element.
Returns
void
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|PromiseLike<void>
Defined in: src/ui/dialogs/entitydialog.tsx:129
Hook invoked after the dialog is initialized, which may be async in a dialog that defers its initialization, see Widget.isDeferredInit.
Returns
void | PromiseLike<void>
afterLoadEntity()
protectedafterLoadEntity():void
Defined in: src/ui/dialogs/entitydialog.tsx:600
Hook invoked after loading an entity; updates the interface and title.
Returns
void
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
arrange()
arrange():
void
Defined in: src/ui/dialogs/basedialog.tsx:321
Triggers layout on all elements that require it.
Returns
void
Inherited from
beforeLoadEntity()
protectedbeforeLoadEntity(entity):void
Defined in: src/ui/dialogs/entitydialog.tsx:593
Hook invoked before loading an entity; clears localization state.
Parameters
entity
TItem
The entity being loaded.
Returns
void
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
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
commitEdits()
protectedcommitEdits():Promise<boolean>
Defined in: src/ui/dialogs/entitydialog.tsx:848
Commits pending edits in the property grid.
Returns
Promise<boolean>
True when the commit succeeds.
deferredInit()
protecteddeferredInit():void|PromiseLike<void>
Defined in: src/ui/dialogs/entitydialog.tsx:79
Initializes a dialog that defers its initialization (see Widget.isDeferredInit): its form and localizer, with the property items it loads asynchronously, and then afterInit, either of which may be async.
Returns
void | PromiseLike<void>
Overrides
deleteHandler()
protecteddeleteHandler(options,callback):PromiseLike<DeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:304
Executes the delete service call.
Parameters
options
ServiceOptions<DeleteResponse>
Service options.
callback
(response) => void
Callback invoked on success.
Returns
PromiseLike<DeleteResponse>
A promise resolving to the delete response.
destroy()
destroy():
void
Defined in: src/ui/dialogs/entitydialog.tsx:145
Cleans up the property grid, localizer, and toolbar buttons.
Returns
void
Overrides
dialogClose()
dialogClose(
result?):void
Defined in: src/ui/dialogs/basedialog.tsx:356
Closes the dialog with the given result.
Parameters
result?
string
The close result.
Returns
void
Inherited from
dialogOpen()
dialogOpen(
asPanel?):void
Defined in: src/ui/dialogs/basedialog.tsx:209
Opens the dialog, optionally as a panel.
Parameters
asPanel?
boolean
When true, opens as a panel instead of a modal dialog.
Returns
void
Inherited from
doDelete()
protecteddoDelete(callback):PromiseLike<DeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:321
Deletes the current entity.
Parameters
callback
(response) => void
Callback invoked on success.
Returns
PromiseLike<DeleteResponse>
A promise resolving to the delete response.
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
get_entityId()
protectedget_entityId():any
Defined in: src/ui/dialogs/entitydialog.tsx:170
Returns
any
Deprecated
use entityId
get_readOnly()
get_readOnly():
boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1179
Returns whether the dialog is in read-only mode.
Returns
boolean
True when read-only.
Implementation of
getCloningEntity()
protectedgetCloningEntity():TItem
Defined in: src/ui/dialogs/entitydialog.tsx:1074
Returns a clone of the current entity with identity and state fields removed.
Returns
TItem
The cloning entity.
getConcurrencyVersionProperty()
protectedgetConcurrencyVersionProperty():string
Defined in: src/ui/dialogs/entitydialog.tsx:477
Returns the concurrency version property for the entity, if any.
Returns
string
The concurrency version property name.
getCreateServiceMethod()
protectedgetCreateServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:868
Returns the create service method name.
Returns
string
The service method.
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
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
getDeleteOptions()
protectedgetDeleteOptions(callback):ServiceOptions<DeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:281
Returns the options for the delete service call.
Parameters
callback
(response) => void
Callback invoked on success.
Returns
ServiceOptions<DeleteResponse>
Service options.
getDeletePermission()
protectedgetDeletePermission():string
Defined in: src/ui/dialogs/entitydialog.tsx:1219
Returns the delete permission for the entity.
Returns
string
The delete permission, or undefined.
getDeleteRequest()
protectedgetDeleteRequest():DeleteRequest
Defined in: src/ui/dialogs/entitydialog.tsx:270
Returns the delete request for the current entity.
Returns
The delete request.
getDeleteServiceMethod()
protectedgetDeleteServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:312
Returns the delete service method name.
Returns
string
The service method.
getDialogButtons()
protectedgetDialogButtons():DialogButton[]
Defined in: src/ui/dialogs/basedialog.tsx:348
Returns the dialog buttons for this dialog.
Returns
Dialog button definitions.
Inherited from
getDialogOptions()
protectedgetDialogOptions():DialogOptions
Defined in: src/ui/dialogs/basedialog.tsx:148
Returns the options used to create the underlying dialog.
Returns
Dialog options.
Inherited from
getEntityNameFieldValue()
protectedgetEntityNameFieldValue():any
Defined in: src/ui/dialogs/entitydialog.tsx:191
Returns the value of the entity name field.
Returns
any
The name field value.
getEntitySingular()
protectedgetEntitySingular():string
Defined in: src/ui/dialogs/entitydialog.tsx:414
Returns the localized singular name for the entity.
Returns
string
The entity singular name.
getEntityTitle()
protectedgetEntityTitle():string
Defined in: src/ui/dialogs/entitydialog.tsx:199
Returns the title for the dialog based on the current mode.
Returns
string
The dialog title.
getEntityType()
protectedgetEntityType():string
Defined in: src/ui/dialogs/entitydialog.tsx:347
Returns the entity type name derived from the dialog class name.
Returns
string
The entity type.
getFormKey()
protectedgetFormKey():string
Defined in: src/ui/dialogs/entitydialog.tsx:372
Returns the form key used to load property items.
Returns
string
The form key.
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/dialogs/entitydialog.tsx:444
Returns the id property for the entity.
Returns
string
The id property name.
getInitialDialogTitle()
protectedgetInitialDialogTitle():string
Defined in: src/ui/dialogs/basedialog.tsx:132
Returns the initial dialog title.
Returns
string
The initial title text.
Inherited from
BaseDialog.getInitialDialogTitle
getInsertPermission()
protectedgetInsertPermission():string
Defined in: src/ui/dialogs/entitydialog.tsx:1203
Returns the insert permission for the entity.
Returns
string
The insert permission, or undefined.
getIsActiveProperty()
protectedgetIsActiveProperty():string
Defined in: src/ui/dialogs/entitydialog.tsx:461
Returns the is-active property for the entity.
Returns
string
The is-active property name.
getIsDeletedProperty()
protectedgetIsDeletedProperty():string
Defined in: src/ui/dialogs/entitydialog.tsx:469
Returns
string
getLanguages()
protectedgetLanguages():LanguageList
Defined in: src/ui/dialogs/entitydialog.tsx:755
Returns the list of languages for localization.
Returns
The language list.
getLoadByIdOptions()
protectedgetLoadByIdOptions(id,callback):ServiceOptions<RetrieveResponse<TItem>>
Defined in: src/ui/dialogs/entitydialog.tsx:640
Returns the options for the retrieve service call.
Parameters
id
any
The entity id to load.
callback
(response) => void
Callback invoked on success.
Returns
ServiceOptions<RetrieveResponse<TItem>>
Service options.
getLoadByIdRequest()
protectedgetLoadByIdRequest(id):RetrieveRequest
Defined in: src/ui/dialogs/entitydialog.tsx:658
Returns the retrieve request for an entity id.
Parameters
id
any
The entity id.
Returns
The retrieve request.
getLocalizerOptions()
protectedgetLocalizerOptions():EntityLocalizerOptions
Defined in: src/ui/dialogs/entitydialog.tsx:726
Returns the options for the entity localizer.
Returns
Localizer options.
getLocalTextDbPrefix()
protectedgetLocalTextDbPrefix():string
Defined in: src/ui/dialogs/entitydialog.tsx:385
Returns the local text database prefix for this dialog.
Returns
string
The local text db prefix.
getLocalTextPrefix()
protectedgetLocalTextPrefix():string
Defined in: src/ui/dialogs/entitydialog.tsx:401
Returns the local text prefix for this dialog.
Returns
string
The local text prefix.
getNameProperty()
protectedgetNameProperty():string
Defined in: src/ui/dialogs/entitydialog.tsx:427
Returns the name property for the entity.
Returns
string
The name property name.
getPropertyGridOptions()
protectedgetPropertyGridOptions():PropertyGridOptions
Defined in: src/ui/dialogs/entitydialog.tsx:833
Returns the options for the property grid.
Returns
Property grid options.
getPropertyItems()
protectedgetPropertyItems():PropertyItem[]
Defined in: src/ui/dialogs/entitydialog.tsx:786
Returns the property items for this dialog.
Returns
The property items.
getPropertyItemsData()
protectedgetPropertyItemsData():PropertyItemsData
Defined in: src/ui/dialogs/entitydialog.tsx:794
Loads the property items data, either from script data or local items.
Returns
The property items data.
getPropertyItemsDataAsync()
protectedgetPropertyItemsDataAsync():Promise<PropertyItemsData>
Defined in: src/ui/dialogs/entitydialog.tsx:815
Asynchronously loads the property items data, which a dialog 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.
getRetrieveServiceMethod()
protectedgetRetrieveServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:675
Returns the retrieve service method name.
Returns
string
The service method.
getRowDefinition()
protectedgetRowDefinition():IRowDefinition
Defined in: src/ui/dialogs/entitydialog.tsx:337
Returns the row definition for this dialog.
Returns
The row definition, or null.
getSaveEntity()
protectedgetSaveEntity():TItem
Defined in: src/ui/dialogs/entitydialog.tsx:907
Returns the entity populated from the property grid.
Returns
TItem
The saved entity.
getSaveOptions()
protectedgetSaveOptions(callback,initiator?):ServiceOptions<SaveResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:886
Returns the options for the save service call.
Parameters
callback
(response) => void
Callback invoked on success.
initiator?
How the save was initiated.
Returns
Service options.
getSaveRequest()
protectedgetSaveRequest():SaveRequest<TItem>
Defined in: src/ui/dialogs/entitydialog.tsx:934
Returns the save request for the current entity.
Returns
SaveRequest<TItem>
The save request.
getService()
protectedgetService():string
Defined in: src/ui/dialogs/entitydialog.tsx:483
Returns
string
getToolbarButtons()
protectedgetToolbarButtons():ToolButton[]
Defined in: src/ui/dialogs/entitydialog.tsx:1001
Returns the toolbar buttons for the entity dialog.
Returns
Tool button definitions.
Overrides
getUndeleteOptions()
protectedgetUndeleteOptions(callback?):ServiceOptions<UndeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:1118
Returns the options for the undelete service call.
Parameters
callback?
(response) => void
Optional callback invoked on success.
Returns
ServiceOptions<UndeleteResponse>
Service options.
getUndeletePermission()
protectedgetUndeletePermission():string
Defined in: src/ui/dialogs/entitydialog.tsx:1236
Returns the permission key required to undelete a row.
Returns
string
Undelete permission or undefined.
getUndeleteRequest()
protectedgetUndeleteRequest():UndeleteRequest
Defined in: src/ui/dialogs/entitydialog.tsx:1109
Returns the undelete request for the current entity.
Returns
The undelete request.
getUndeleteServiceMethod()
protectedgetUndeleteServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:1149
Returns the undelete service method name.
Returns
string
The service method.
getUpdatePermission()
protectedgetUpdatePermission():string
Defined in: src/ui/dialogs/entitydialog.tsx:1211
Returns the update permission for the entity.
Returns
string
The update permission, or undefined.
getUpdateServiceMethod()
protectedgetUpdateServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:876
Returns the update service method name.
Returns
string
The service method.
getValidatorOptions()
protectedgetValidatorOptions():any
Defined in: src/ui/dialogs/basedialog.tsx:288
Returns the validator options for the form.
Returns
any
Validator options.
Inherited from
BaseDialog.getValidatorOptions
handleResponsive()
protectedhandleResponsive():void
Defined in: src/ui/dialogs/basedialog.tsx:387
Handles responsive layout for the dialog.
Returns
void
Inherited from
hasDeletePermission()
protectedhasDeletePermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1227
Whether the current user has delete permission.
Returns
boolean
True when permitted.
hasInsertPermission()
protectedhasInsertPermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1253
Whether the current user has insert permission.
Returns
boolean
True when permitted.
hasSavePermission()
protectedhasSavePermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1271
Whether the current user has save permission (insert or update).
Returns
boolean
True when permitted.
hasUndeletePermission()
protectedhasUndeletePermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1244
Checks whether the current user may undelete rows.
Returns
boolean
True when undeletion is allowed.
hasUpdatePermission()
protectedhasUpdatePermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1262
Whether the current user has update permission.
Returns
boolean
True when permitted.
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<EntityDialog<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<EntityDialog<TItem, P>>
A promise of this widget, which is rejected when its initialization fails.
Inherited from
initDialog()
protectedinitDialog():void
Defined in: src/ui/dialogs/basedialog.tsx:179
Initializes the underlying dialog element.
Returns
void
Inherited from
initLocalizer()
protectedinitLocalizer():void
Defined in: src/ui/dialogs/entitydialog.tsx:746
Initializes the entity localizer.
Returns
void
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
initPropertyGrid()
protectedinitPropertyGrid():void
Defined in: src/ui/dialogs/entitydialog.tsx:774
Initializes the property grid from the PropertyGrid element.
Returns
void
initTabs()
protectedinitTabs():void
Defined in: src/ui/dialogs/basedialog.tsx:377
Initializes the tabs from the Tabs element.
Returns
void
Inherited from
initToolbar()
protectedinitToolbar():void
Defined in: src/ui/dialogs/basedialog.tsx:273
Initializes the toolbar from the Toolbar element.
Returns
void
Inherited from
initUIDialog()
protectedinitUIDialog():void
Defined in: src/ui/dialogs/basedialog.tsx:191
Initializes jQuery UI dialog-specific behavior.
Returns
void
Inherited from
initValidator()
protectedinitValidator():void
Defined in: src/ui/dialogs/basedialog.tsx:295
Initializes the form validator.
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
BaseDialog.internalRenderContents
isCloneMode()
protectedisCloneMode():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:219
Whether the dialog is in clone mode.
Returns
boolean
True when cloning.
isDeleted()
protectedisDeleted():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:235
Whether the current entity is soft-deleted.
Returns
boolean
True when deleted.
isEditMode()
protectedisEditMode():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:227
Whether the dialog is editing an existing entity.
Returns
boolean
True when editing.
isNew()
protectedisNew():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:254
Whether the dialog is creating a new entity.
Returns
boolean
True when new.
isNewOrDeleted()
protectedisNewOrDeleted():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:262
Whether the entity is new or soft-deleted.
Returns
boolean
True when new or deleted.
isStaticPanel()
protectedisStaticPanel():boolean
Defined in: src/ui/dialogs/basedialog.tsx:140
Whether the dialog renders as a static panel.
Returns
boolean
True when static.
Inherited from
isViewMode()
protectedisViewMode():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1281
Whether the dialog is in view mode (read-only display of an existing entity).
Returns
boolean
True when in view mode.
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
BaseDialog.legacyTemplateRender
load()
load(
entityOrId,done,fail?):PromiseLike<RetrieveResponse<TItem>>
Defined in: src/ui/dialogs/entitydialog.tsx:497
Loads an entity or id into the dialog.
Parameters
entityOrId
any
Entity instance or identifier to load.
done
() => void
Callback invoked when loading completes.
fail?
(ex) => void
Optional callback invoked on failure.
Returns
PromiseLike<RetrieveResponse<TItem>>
A promise resolving to the retrieve response.
Implementation of
loadById()
loadById(
id,callback?,fail?):PromiseLike<RetrieveResponse<TItem>>
Defined in: src/ui/dialogs/entitydialog.tsx:686
Loads an entity by id.
Parameters
id
any
The entity id.
callback?
(response) => void
Optional callback invoked on success.
fail?
() => void
Optional callback invoked on failure.
Returns
PromiseLike<RetrieveResponse<TItem>>
A promise resolving to the retrieve response.
loadByIdAndOpenDialog()
loadByIdAndOpenDialog(
entityId,asPanel?,callback?,fail?):PromiseLike<RetrieveResponse<TItem>>
Defined in: src/ui/dialogs/entitydialog.tsx:613
Loads an entity by id and opens the dialog.
Parameters
entityId
any
The entity id to load.
asPanel?
boolean
When true, opens as a panel.
callback?
(response) => void
Optional callback invoked on success.
fail?
() => void
Optional callback invoked on failure.
Returns
PromiseLike<RetrieveResponse<TItem>>
A promise resolving to the retrieve response.
loadByIdHandler()
protectedloadByIdHandler(options,callback,fail):PromiseLike<RetrieveResponse<TItem>>
Defined in: src/ui/dialogs/entitydialog.tsx:697
Executes the retrieve service call.
Parameters
options
ServiceOptions<RetrieveResponse<TItem>>
Service options.
callback
(response) => void
Callback invoked on success.
fail
() => void
Callback invoked on failure.
Returns
PromiseLike<RetrieveResponse<TItem>>
A promise resolving to the retrieve response.
loadEntity()
protectedloadEntity(entity):void
Defined in: src/ui/dialogs/entitydialog.tsx:577
Loads an entity into the property grid.
Parameters
entity
TItem
The entity to load.
Returns
void
loadEntityAndOpenDialog()
loadEntityAndOpenDialog(
entity,asPanel?):void
Defined in: src/ui/dialogs/entitydialog.tsx:546
Loads an entity and opens the dialog.
Parameters
entity
TItem
The entity to load.
asPanel?
boolean
When true, opens as a panel.
Returns
void
loadNewAndOpenDialog()
loadNewAndOpenDialog(
asPanel?):void
Defined in: src/ui/dialogs/entitydialog.tsx:536
Loads a new empty entity and opens the dialog.
Parameters
asPanel?
boolean
When true, opens as a panel.
Returns
void
loadResponse()
protectedloadResponse(data):void
Defined in: src/ui/dialogs/entitydialog.tsx:555
Loads a retrieve response into the dialog.
Parameters
data
any
The retrieve response data.
Returns
void
mapSourceItem()
protectedmapSourceItem(item):PropertyItem
Defined in: src/ui/dialogs/entitydialog.tsx:767
Maps a property item to the item used in the localization grid. The default returns
the item as is (return null for the same effect). Override to clear or modify
permissions / insertable / updatable flags, or to exclude items by returning an item
with localizable: false.
Parameters
item
Property item.
Returns
The item to use, or null to use the item as is.
onClose()
onClose(
handler,opt?):void
Defined in: src/ui/dialogs/basedialog.tsx:253
Attaches a dialog/modal/panel close event handler. See Dialog.close for more info.
Parameters
handler
(result?, e?) => void
opt?
before?
boolean
oneOff?
boolean
Returns
void
Inherited from
onDeleteSuccess()
protectedonDeleteSuccess(response):void
Defined in: src/ui/dialogs/entitydialog.tsx:330
Hook invoked after a successful delete.
Parameters
response
The delete response.
Returns
void
onDialogClose()
protectedonDialogClose(result?):void
Defined in: src/ui/dialogs/basedialog.tsx:331
Hook invoked when the dialog closes; destroys the dialog and removes its element.
Parameters
result?
string
The close result.
Returns
void
Inherited from
onDialogOpen()
protectedonDialogOpen():void
Defined in: src/ui/dialogs/basedialog.tsx:245
Hook invoked when the dialog opens; focuses the first input and arranges layout.
Returns
void
Inherited from
onLoadingData()
protectedonLoadingData(data):void
Defined in: src/ui/dialogs/entitydialog.tsx:631
Hook invoked when data starts loading.
Parameters
data
RetrieveResponse<TItem>
The retrieve response data.
Returns
void
onOpen()
onOpen(
handler,opt?):void
Defined in: src/ui/dialogs/basedialog.tsx:258
Attaches a dialog/modal/panel open event handler. See Dialog.open for more info.
Parameters
handler
(e?) => void
opt?
before?
boolean
oneOff?
boolean
Returns
void
Inherited from
onSaveSuccess()
protectedonSaveSuccess(response,initiator?):void
Defined in: src/ui/dialogs/entitydialog.tsx:950
Hook invoked after a successful save.
Parameters
response
The save response.
initiator?
How the save was initiated.
Returns
void
propertyItemsReady()
protectedpropertyItemsReady(itemsData):void|PromiseLike<void>
Defined in: src/ui/dialogs/entitydialog.tsx:115
Called once property items are available; initializes the property grid and localizer.
Parameters
itemsData
Property items data.
Returns
void | PromiseLike<void>
raiseAfterInit()
protectedraiseAfterInit():void
Defined in: src/ui/dialogs/basedialog.tsx:234
Raises onAfterInit of the class and of the dialog, once. A dialog that raises it itself, e.g. PropertyDialog, calls it when its initialization ends; others may call it at the end of their constructor, else it is called when the dialog is opened first.
Returns
void
Inherited from
reloadById()
protectedreloadById():void
Defined in: src/ui/dialogs/entitydialog.tsx:667
Reloads the current entity by id.
Returns
void
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/dialogs/entitydialog.tsx:1297
Renders the dialog contents with toolbar, form, and property grid.
Returns
any
The rendered content.
Overrides
resetValidation()
protectedresetValidation():void
Defined in: src/ui/dialogs/basedialog.tsx:306
Resets all validation state.
Returns
void
Inherited from
retrieveLocalizations()
protectedretrieveLocalizations():Promise<Record<string,Partial<TItem>>>
Defined in: src/ui/dialogs/entitydialog.tsx:707
Retrieves existing localizations for the current entity.
Returns
Promise<Record<string, Partial<TItem>>>
A promise resolving to the localizations keyed by language.
save()
protectedsave(callback?,initiator?):false|PromiseLike<SaveResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:971
Validates and saves the entity.
Parameters
callback?
(response) => void
Optional callback invoked on success.
initiator?
How the save was initiated.
Returns
false | PromiseLike<SaveResponse>
A promise resolving to the save response, or false when validation fails.
save_submitHandler()
protectedsave_submitHandler(callback,initiator):PromiseLike<SaveResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:960
Submits the save after validation.
Parameters
callback
(response) => void
Callback invoked on success.
initiator
How the save was initiated.
Returns
PromiseLike<SaveResponse>
A promise resolving to the save response.
saveHandler()
protectedsaveHandler(options,callback,initiator):PromiseLike<SaveResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:984
Executes the save service call.
Parameters
options
Service options.
callback
(response) => void
Callback invoked on success.
initiator
How the save was initiated.
Returns
PromiseLike<SaveResponse>
A promise resolving to the save response.
set_readOnly()
set_readOnly(
value):void
Defined in: src/ui/dialogs/entitydialog.tsx:1187
Sets whether the dialog is in read-only mode and updates the interface.
Parameters
value
boolean
True to enable read-only mode.
Returns
void
Implementation of
showSaveSuccessMessage()
protectedshowSaveSuccessMessage(response,initiator?):void
Defined in: src/ui/dialogs/entitydialog.tsx:993
Shows a success message after saving.
Parameters
response
The save response.
initiator?
How the save was initiated.
Returns
void
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
undelete()
protectedundelete(callback?):void|PromiseLike<UndeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:1158
Undeletes the current entity.
Parameters
callback?
(response) => void
Optional callback invoked on success.
Returns
void | PromiseLike<UndeleteResponse>
Void or a promise resolving to the undelete response.
undeleteHandler()
protectedundeleteHandler(options,callback?):PromiseLike<UndeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:1141
Executes the undelete service call.
Parameters
options
ServiceOptions<UndeleteResponse>
Service options.
callback?
(response) => void
Optional callback invoked on success.
Returns
PromiseLike<UndeleteResponse>
A promise resolving to the undelete response.
updateInterface()
protectedupdateInterface():void
Defined in: src/ui/dialogs/entitydialog.tsx:1096
Updates the interface to reflect the current mode and permissions.
Returns
void
updateTitle()
protectedupdateTitle():void
Defined in: src/ui/dialogs/entitydialog.tsx:211
Updates the dialog title from the entity.
Returns
void
useAsync()
protecteduseAsync():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:138
Whether property items should be loaded 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.
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
useViewMode()
protecteduseViewMode():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1289
Whether view mode is enabled for this dialog.
Returns
boolean
True when view mode is used.
validateBeforeSave()
protectedvalidateBeforeSave():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:860
Validates the form before saving.
Returns
boolean
True when the form is valid.
validateForm()
protectedvalidateForm():boolean
Defined in: src/ui/dialogs/basedialog.tsx:314
Validates the form.
Returns
boolean
True when the form is valid.
Inherited from
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():HTMLDivElement
Defined in: src/ui/dialogs/basedialog.tsx:22
Creates the default DOM element for a widget.
Returns
HTMLDivElement
A new div element.
Inherited from
BaseDialog.createDefaultElement
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
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.