@serenity-is/corelib / EntityDialog
Class: EntityDialog<TItem, P>
Defined in: src/ui/dialogs/entitydialog.tsx:23
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:47
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:34
cloneButton
protectedcloneButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:37
deleteButton
protecteddeleteButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:35
dialog
protecteddialog:Dialog
Defined in: src/ui/dialogs/basedialog.tsx:25
Inherited from
domNode
readonlydomNode:HTMLElement
Defined in: src/ui/widgets/widget.ts:24
The DOM node this widget is bound to.
Inherited from
editButton
protectededitButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:38
editClicked
protectededitClicked:boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1138
idPrefix
readonlyidPrefix:string
Defined in: src/ui/widgets/widget.ts:22
The id prefix used for this widget's child element ids.
Inherited from
localizer
protectedlocalizer:EntityLocalizer
Defined in: src/ui/dialogs/entitydialog.tsx:40
localizerButton
protectedlocalizerButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:41
options
protectedreadonlyoptions:WidgetProps<P>
Defined in: src/ui/widgets/widget.ts:18
The widget's options/props.
Inherited from
propertyGrid
protectedpropertyGrid:PropertyGrid
Defined in: src/ui/dialogs/entitydialog.tsx:31
propertyItemsData
protectedpropertyItemsData:PropertyItemsData
Defined in: src/ui/dialogs/entitydialog.tsx:30
saveAndCloseButton
protectedsaveAndCloseButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:33
tabs
protectedtabs:Fluent<HTMLElement>
Defined in: src/ui/dialogs/basedialog.tsx:22
Inherited from
toolbar
protectedtoolbar:Toolbar
Defined in: src/ui/dialogs/basedialog.tsx:23
Inherited from
undeleteButton
protectedundeleteButton:Fluent
Defined in: src/ui/dialogs/entitydialog.tsx:36
uniqueName
readonlyuniqueName:string
Defined in: src/ui/widgets/widget.ts:20
A unique name for this widget instance, used for event namespacing.
Inherited from
validator
protectedvalidator:any
Defined in: src/ui/dialogs/basedialog.tsx:24
Inherited from
[typeInfo]
static[typeInfo]:ClassTypeInfo<"Serenity.">
Defined in: src/ui/dialogs/entitydialog.tsx:25
Implementation of
Overrides
isComponent
readonlystaticisComponent:true=true
Defined in: src/ui/widgets/widget.ts:334
Inherited from
Accessors
dialogTitle
Get Signature
get dialogTitle():
string
Defined in: src/ui/dialogs/basedialog.tsx:291
Returns the current dialog title.
Returns
string
The dialog title.
Set Signature
set dialogTitle(
value):void
Defined in: src/ui/dialogs/basedialog.tsx:296
Sets the dialog title.
Parameters
value
string
Returns
void
Inherited from
element
Get Signature
get element():
Fluent
Defined in: src/ui/widgets/widget.ts:82
Returns a Fluent(this.domNode) object
Returns
Inherited from
entity
Get Signature
get entity():
TItem
Defined in: src/ui/dialogs/entitydialog.tsx:97
Returns the current entity.
Returns
TItem
The entity.
Set Signature
set entity(
value):void
Defined in: src/ui/dialogs/entitydialog.tsx:102
Sets the current entity.
Parameters
value
TItem
Returns
void
entityId
Get Signature
get entityId():
any
Defined in: src/ui/dialogs/entitydialog.tsx:115
Returns the current entity id.
Returns
any
The entity id.
Set Signature
set entityId(
value):void
Defined in: src/ui/dialogs/entitydialog.tsx:120
Sets the current entity id.
Parameters
value
any
Returns
void
props
Get Signature
get props():
WidgetProps<P>
Defined in: src/ui/widgets/widget.ts:307
Returns the widget's props/options.
Returns
WidgetProps<P>
Inherited from
readOnly
Get Signature
get readOnly():
boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1050
Whether the dialog is in read-only mode.
Returns
boolean
Set Signature
set readOnly(
value):void
Defined in: src/ui/dialogs/entitydialog.tsx:1055
Sets whether the dialog is in read-only mode.
Parameters
value
boolean
Returns
void
defaultLanguageList
Get Signature
get
staticdefaultLanguageList():string[][]
Defined in: src/ui/dialogs/entitydialog.tsx:1179
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:1184
Sets the default language list for localization.
Parameters
value
string[][]
Returns
void
Methods
addCssClass()
protectedaddCssClass():void
Defined in: src/ui/dialogs/basedialog.tsx:73
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:142
Adds a validation rule to the widget's DOM node.
Parameters
rule
(input) => string
The validation rule function, or a unique name when the two-argument overload is used.
uniqueName?
string
A unique name for the rule, or the rule function when the two-argument overload is used.
Returns
void
Inherited from
Call Signature
addValidationRule(
uniqueName,rule):void
Defined in: src/ui/widgets/widget.ts:143
Adds a validation rule to the widget's DOM node.
Parameters
uniqueName
string
A unique name for the rule, or the rule function when the two-argument overload is used.
rule
(input) => string
The validation rule function, or a unique name when the two-argument overload is used.
Returns
void
Inherited from
afterInit()
protectedafterInit():void
Defined in: src/ui/dialogs/entitydialog.tsx:69
Hook invoked after the dialog is initialized.
Returns
void
afterLoadEntity()
protectedafterLoadEntity():void
Defined in: src/ui/dialogs/entitydialog.tsx:520
Hook invoked after loading an entity; updates the interface and title.
Returns
void
afterRender()
protectedafterRender(callback):void
Defined in: src/ui/widgets/widget.ts:228
Queues a callback to run after the widget's contents are rendered.
Parameters
callback
() => void
The callback to run after rendering.
Returns
void
Inherited from
arrange()
arrange():
void
Defined in: src/ui/dialogs/basedialog.tsx:248
Triggers layout on all elements that require it.
Returns
void
Inherited from
beforeLoadEntity()
protectedbeforeLoadEntity(entity):void
Defined in: src/ui/dialogs/entitydialog.tsx:513
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:154
Finds a child element by its prefix-relative id.
Type Parameters
TElement
TElement extends HTMLElement = HTMLElement
Parameters
id
string
The id relative to the widget's id prefix.
Returns
Fluent<TElement>
A Fluent wrapper for the matching element.
Inherited from
change()
change(
handler):void
Defined in: src/ui/widgets/widget.ts:179
Registers a change handler on the widget's DOM node.
Parameters
handler
(e) => void
The change event handler.
Returns
void
Inherited from
changeSelect2()
changeSelect2(
handler):void
Defined in: src/ui/widgets/widget.ts:188
Registers a change handler that ignores changes originating from
combobox setting values.
Parameters
handler
(e) => void
The change event handler.
Returns
void
Inherited from
commitEdits()
protectedcommitEdits():Promise<boolean>
Defined in: src/ui/dialogs/entitydialog.tsx:742
Commits pending edits in the property grid.
Returns
Promise<boolean>
True when the commit succeeds.
deferRender()
protecteddeferRender():boolean
Defined in: src/ui/widgets/widget.ts:98
Determines whether rendering should be deferred until init is called.
Returns
boolean
True to defer rendering.
Inherited from
deleteHandler()
protecteddeleteHandler(options,callback):PromiseLike<DeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:241
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:83
Cleans up the property grid, localizer, and toolbar buttons.
Returns
void
Overrides
dialogClose()
dialogClose(
result?):void
Defined in: src/ui/dialogs/basedialog.tsx:283
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:158
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:258
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:163
Finds a child element by its prefix-relative id.
Type Parameters
TElement
TElement extends HTMLElement = HTMLElement
Parameters
id
string
The id relative to the widget's id prefix.
Returns
TElement
The matching element, or null if not found.
Inherited from
get_entityId()
protectedget_entityId():any
Defined in: src/ui/dialogs/entitydialog.tsx:107
Returns
any
Deprecated
use entityId
get_readOnly()
get_readOnly():
boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1063
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:958
Returns a clone of the current entity with identity and state fields removed.
Returns
TItem
The cloning entity.
getCreateServiceMethod()
protectedgetCreateServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:762
Returns the create service method name.
Returns
string
The service method.
getCssClass()
protectedgetCssClass():string
Defined in: src/ui/widgets/widget.ts:106
Returns the CSS class(es) applied to the widget's DOM node.
Returns
string
The space-separated CSS class string.
Inherited from
getCustomAttribute()
protectedgetCustomAttribute<TAttr>(attrType,inherit):TAttr
Defined in: src/ui/widgets/widget.ts:220
Returns a custom attribute applied to the widget's type.
Type Parameters
TAttr
TAttr extends CustomAttribute
Parameters
attrType
(...args) => TAttr
The attribute type to look up.
inherit
boolean = true
Whether to search inherited types; defaults to true.
Returns
TAttr
The matching attribute, or null.
Inherited from
getDeleteOptions()
protectedgetDeleteOptions(callback):ServiceOptions<DeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:218
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:1099
Returns the delete permission for the entity.
Returns
string
The delete permission, or undefined.
getDeleteRequest()
protectedgetDeleteRequest():DeleteRequest
Defined in: src/ui/dialogs/entitydialog.tsx:207
Returns the delete request for the current entity.
Returns
The delete request.
getDeleteServiceMethod()
protectedgetDeleteServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:249
Returns the delete service method name.
Returns
string
The service method.
getDialogButtons()
protectedgetDialogButtons():DialogButton[]
Defined in: src/ui/dialogs/basedialog.tsx:275
Returns the dialog buttons for this dialog.
Returns
Dialog button definitions.
Inherited from
getDialogOptions()
protectedgetDialogOptions():DialogOptions
Defined in: src/ui/dialogs/basedialog.tsx:97
Returns the options used to create the underlying dialog.
Returns
Dialog options.
Inherited from
getEntityNameFieldValue()
protectedgetEntityNameFieldValue():any
Defined in: src/ui/dialogs/entitydialog.tsx:128
Returns the value of the entity name field.
Returns
any
The name field value.
getEntitySingular()
protectedgetEntitySingular():string
Defined in: src/ui/dialogs/entitydialog.tsx:351
Returns the localized singular name for the entity.
Returns
string
The entity singular name.
getEntityTitle()
protectedgetEntityTitle():string
Defined in: src/ui/dialogs/entitydialog.tsx:136
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:284
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:309
Returns the form key used to load property items.
Returns
string
The form key.
getGridField()
getGridField():
Fluent
Defined in: src/ui/widgets/widget.ts:171
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:381
Returns the id property for the entity.
Returns
string
The id property name.
getInitialDialogTitle()
protectedgetInitialDialogTitle():string
Defined in: src/ui/dialogs/basedialog.tsx:81
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:1083
Returns the insert permission for the entity.
Returns
string
The insert permission, or undefined.
getIsActiveProperty()
protectedgetIsActiveProperty():string
Defined in: src/ui/dialogs/entitydialog.tsx:398
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:406
Returns
string
getLanguages()
protectedgetLanguages():LanguageList
Defined in: src/ui/dialogs/entitydialog.tsx:674
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:560
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:578
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:646
Returns the options for the entity localizer.
Returns
Localizer options.
getLocalTextDbPrefix()
protectedgetLocalTextDbPrefix():string
Defined in: src/ui/dialogs/entitydialog.tsx:322
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:338
Returns the local text prefix for this dialog.
Returns
string
The local text prefix.
getNameProperty()
protectedgetNameProperty():string
Defined in: src/ui/dialogs/entitydialog.tsx:364
Returns the name property for the entity.
Returns
string
The name property name.
getPropertyGridOptions()
protectedgetPropertyGridOptions():PropertyGridOptions
Defined in: src/ui/dialogs/entitydialog.tsx:729
Returns the options for the property grid.
Returns
Property grid options.
getPropertyItems()
protectedgetPropertyItems():PropertyItem[]
Defined in: src/ui/dialogs/entitydialog.tsx:693
Returns the property items for this dialog.
Returns
The property items.
getPropertyItemsData()
protectedgetPropertyItemsData():PropertyItemsData
Defined in: src/ui/dialogs/entitydialog.tsx:701
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:720
Asynchronously loads the property items data.
Returns
Promise<PropertyItemsData>
A promise resolving to the property items data.
getRetrieveServiceMethod()
protectedgetRetrieveServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:595
Returns the retrieve service method name.
Returns
string
The service method.
getRowDefinition()
protectedgetRowDefinition():IRowDefinition
Defined in: src/ui/dialogs/entitydialog.tsx:274
Returns the row definition for this dialog.
Returns
The row definition, or null.
getSaveEntity()
protectedgetSaveEntity():TItem
Defined in: src/ui/dialogs/entitydialog.tsx:801
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:780
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:818
Returns the save request for the current entity.
Returns
SaveRequest<TItem>
The save request.
getService()
protectedgetService():string
Defined in: src/ui/dialogs/entitydialog.tsx:412
Returns
string
getToolbarButtons()
protectedgetToolbarButtons():ToolButton[]
Defined in: src/ui/dialogs/entitydialog.tsx:885
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:1002
Returns the options for the undelete service call.
Parameters
callback?
(response) => void
Optional callback invoked on success.
Returns
ServiceOptions<UndeleteResponse>
Service options.
getUndeleteRequest()
protectedgetUndeleteRequest():UndeleteRequest
Defined in: src/ui/dialogs/entitydialog.tsx:993
Returns the undelete request for the current entity.
Returns
The undelete request.
getUndeleteServiceMethod()
protectedgetUndeleteServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:1033
Returns the undelete service method name.
Returns
string
The service method.
getUpdatePermission()
protectedgetUpdatePermission():string
Defined in: src/ui/dialogs/entitydialog.tsx:1091
Returns the update permission for the entity.
Returns
string
The update permission, or undefined.
getUpdateServiceMethod()
protectedgetUpdateServiceMethod():string
Defined in: src/ui/dialogs/entitydialog.tsx:770
Returns the update service method name.
Returns
string
The service method.
getValidatorOptions()
protectedgetValidatorOptions():any
Defined in: src/ui/dialogs/basedialog.tsx:215
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:314
Handles responsive layout for the dialog.
Returns
void
Inherited from
hasDeletePermission()
protectedhasDeletePermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1107
Whether the current user has delete permission.
Returns
boolean
True when permitted.
hasInsertPermission()
protectedhasInsertPermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1116
Whether the current user has insert permission.
Returns
boolean
True when permitted.
hasSavePermission()
protectedhasSavePermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1134
Whether the current user has save permission (insert or update).
Returns
boolean
True when permitted.
hasUpdatePermission()
protectedhasUpdatePermission():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:1125
Whether the current user has update permission.
Returns
boolean
True when permitted.
init()
init():
this
Defined in: src/ui/widgets/widget.ts:243
Initializes the widget, rendering its contents if rendering was deferred.
Returns
this
This widget instance.
Inherited from
initDialog()
protectedinitDialog():void
Defined in: src/ui/dialogs/basedialog.tsx:128
Initializes the underlying dialog element.
Returns
void
Inherited from
initLocalizer()
protectedinitLocalizer():void
Defined in: src/ui/dialogs/entitydialog.tsx:665
Initializes the entity localizer.
Returns
void
initPropertyGrid()
protectedinitPropertyGrid():void
Defined in: src/ui/dialogs/entitydialog.tsx:681
Initializes the property grid from the PropertyGrid element.
Returns
void
initTabs()
protectedinitTabs():void
Defined in: src/ui/dialogs/basedialog.tsx:304
Initializes the tabs from the Tabs element.
Returns
void
Inherited from
initToolbar()
protectedinitToolbar():void
Defined in: src/ui/dialogs/basedialog.tsx:200
Initializes the toolbar from the Toolbar element.
Returns
void
Inherited from
initUIDialog()
protectedinitUIDialog():void
Defined in: src/ui/dialogs/basedialog.tsx:140
Initializes jQuery UI dialog-specific behavior.
Returns
void
Inherited from
initValidator()
protectedinitValidator():void
Defined in: src/ui/dialogs/basedialog.tsx:222
Initializes the form validator.
Returns
void
Inherited from
internalRenderContents()
internalRenderContents():
void
Defined in: src/ui/widgets/widget.ts:266
Renders the widget's contents and runs any queued after-render callbacks.
Returns
void
Inherited from
BaseDialog.internalRenderContents
isCloneMode()
protectedisCloneMode():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:156
Whether the dialog is in clone mode.
Returns
boolean
True when cloning.
isDeleted()
protectedisDeleted():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:172
Whether the current entity is soft-deleted.
Returns
boolean
True when deleted.
isEditMode()
protectedisEditMode():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:164
Whether the dialog is editing an existing entity.
Returns
boolean
True when editing.
isNew()
protectedisNew():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:191
Whether the dialog is creating a new entity.
Returns
boolean
True when new.
isNewOrDeleted()
protectedisNewOrDeleted():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:199
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:89
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:1144
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:291
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:426
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:606
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:533
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:617
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:499
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:475
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:465
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:484
Loads a retrieve response into the dialog.
Parameters
data
any
The retrieve response data.
Returns
void
onClose()
onClose(
handler,opt?):void
Defined in: src/ui/dialogs/basedialog.tsx:180
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:267
Hook invoked after a successful delete.
Parameters
response
The delete response.
Returns
void
onDialogClose()
protectedonDialogClose(result?):void
Defined in: src/ui/dialogs/basedialog.tsx:258
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:172
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:551
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:185
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:834
Hook invoked after a successful save.
Parameters
response
The save response.
initiator?
How the save was initiated.
Returns
void
propertyItemsReady()
protectedpropertyItemsReady(itemsData):void
Defined in: src/ui/dialogs/entitydialog.tsx:60
Called once property items are available; initializes the property grid and localizer.
Parameters
itemsData
Property items data.
Returns
void
reloadById()
protectedreloadById():void
Defined in: src/ui/dialogs/entitydialog.tsx:587
Reloads the current entity by id.
Returns
void
render()
render():
any
Defined in: src/ui/widgets/widget.ts:253
Returns the main element for this widget or the document fragment. As widgets may get their elements from props unlike regular JSX widgets, this method should not be overridden. Override renderContents() instead.
Returns
any
Inherited from
renderContents()
protectedrenderContents():any
Defined in: src/ui/dialogs/entitydialog.tsx:1160
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:233
Resets all validation state.
Returns
void
Inherited from
retrieveLocalizations()
protectedretrieveLocalizations():Promise<Record<string,Partial<TItem>>>
Defined in: src/ui/dialogs/entitydialog.tsx:627
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:855
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:844
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:868
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:1071
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:877
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:318
Runs a method synchronously or asynchronously depending on the widget's
useAsync flag, then invokes a continuation.
Type Parameters
T
T
Parameters
syncMethod
() => T
The synchronous method to run.
asyncMethod
() => PromiseLike<T>
The asynchronous method to run.
then
(v) => void
The continuation invoked with the result.
Returns
void
Inherited from
undelete()
protectedundelete(callback?):void|PromiseLike<UndeleteResponse>
Defined in: src/ui/dialogs/entitydialog.tsx:1042
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:1025
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:980
Updates the interface to reflect the current mode and permissions.
Returns
void
updateTitle()
protectedupdateTitle():void
Defined in: src/ui/dialogs/entitydialog.tsx:148
Updates the dialog title from the entity.
Returns
void
useAsync()
protecteduseAsync():boolean
Defined in: src/ui/dialogs/entitydialog.tsx:76
Whether property items should be loaded asynchronously.
Returns
boolean
True when async loading is used.
useIdPrefix()
protecteduseIdPrefix():IdPrefixType
Defined in: src/ui/widgets/widget.ts:329
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:1152
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:754
Validates the form before saving.
Returns
boolean
True when the form is valid.
validateForm()
protectedvalidateForm():boolean
Defined in: src/ui/dialogs/basedialog.tsx:241
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:202
Creates a widget instance from the given params, appending its element to the container and invoking the init/init callbacks.
Type Parameters
TWidget
TWidget extends Widget<P>
P
P
Parameters
params
CreateWidgetParams<TWidget, P>
The widget creation params.
Returns
TWidget
The created widget instance.
Inherited from
createDefaultElement()
staticcreateDefaultElement():HTMLDivElement
Defined in: src/ui/dialogs/basedialog.tsx:20
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:131
Returns the widget name for a type, used for association and unique names.
Parameters
type
Function
The widget type.
Returns
string
The widget name.
Inherited from
registerClass()
protectedstaticregisterClass<TypeName>(typeName,intfAndAttr?):ClassTypeInfo<TypeName>
Defined in: src/ui/widgets/widget.ts:342
Registers this type as a class with the given type name.
Type Parameters
TypeName
TypeName
Parameters
typeName
StringLiteral<TypeName>
The type name to register.
intfAndAttr?
(InterfaceType | AttributeSpecifier)[]
Optional interfaces and attributes.
Returns
ClassTypeInfo<TypeName>
The class type info.
Inherited from
registerEditor()
protectedstaticregisterEditor<TypeName>(typeName,intfAndAttr?):EditorTypeInfo<TypeName>
Defined in: src/ui/widgets/widget.ts:357
Registers this type as an editor with the given type name.
Type Parameters
TypeName
TypeName
Parameters
typeName
StringLiteral<TypeName>
The type name to register.
intfAndAttr?
(InterfaceType | AttributeSpecifier)[]
Optional interfaces and attributes.
Returns
EditorTypeInfo<TypeName>
The editor type info.