Skip to main content
Version: Current

foundation-entity-management.entitymanagement

Home > @genesislcap/foundation-entity-management > EntityManagement

EntityManagement class

Main class which defines the entity management functionality

Signature:

export declare class EntityManagement extends EntityManagement_base 

Extends: EntityManagement_base

Remarks

Connects to a backend resource and wraps up a grid which is populated with entities from that resource. The different interactions that the user can perform with the entities can be configured, examples being able to update and delete entities.

Example

Example of using the entity management system to handle counterparties

<entity-management
resourceName="ALL_COUNTERPARTYS"
title="Counterparty Management"
updateEvent="EVENT_COUNTERPARTY_MODIFY"
deleteEvent="EVENT_COUNTERPARTY_DELETE"
createEvent="EVENT_COUNTERPARTY_INSERT"
></entity-management>

Where:
- the title of the grid is Counterparty Management
- the name of the resource in the database to manage is ALL_COUNTERPARTYS
- the name of the event handler for update events is EVENT_COUNTERPARTY_MODIFY
- the name of the event handler for create events is EVENT_COUNTERPARTY_INSERT
- the name of the event handler for delete events is EVENT_COUNTERPARTY_DELETE

Properties

PropertyModifiersTypeDescription
asyncAddbooleanWhether to use the applyTransactionAsync function for *add* transactions
asyncRemovebooleanWhether to use the applyTransactionAsync function for *remove* transactions
asyncUpdatebooleanWhether to use the applyTransactionAsync function for *update* transactions
columnsColDef[]Array which holds the column definitions.
connectprotectedConnectDI connect object which is used to interact with the backend.
createEventstringName of the event handler on the Genesis server which handles creating an entity
createFormUiSchemaany
datasourceConfigDatasourceConfigurationThe configuration which is used when interacting with the resource on the backend
defaultEntityValuesany
deleteEventstringName of the event handler on the Genesis server which handles deleting the entity
editDialogTitlestringString which contains the text of the popup modal when the user is adding or editing an entity
editedEntityanyDisables the form while enabled to stop the user dispatching a large number of duplicate events
editEntityModalany
editModalVisibleboolean
enableCellFlashingbooleanIf false, will disable cell flashing for all cells by default, unless otherwise defined in custom colDef
enableFilterBarboolean
enableRowFlashingbooleanIf true, will enable row flashing for all rows for add transactions
enableSearchBarboolean
entityLabelstringLabel for the entity which has usages such as being shown in the title of the modal wen editing the entity
formRenderersRendererEntry[]Array with renderers used by foundation-forms
formUiSchemaany
gridOptionsGridOptionsGridOptions to be passed down from application
headerCaseTypeGridProCaseTypeThe case type to use for the header names. If not set, the default CONSTANT_CASE will be used.
headerTempalatereadonlyimport("@microsoft/fast-element").ViewTemplate<EntityManagement, any>
hideDeleteboolean
hideEditboolean
modalPosition'centre' | 'left' | 'right'Determines where the modal dialog will appear on screen
persistColumnStateKeystringThis attribute controls whether and how the entity manager stores the state of the columns when the user edits them. Omit this attribute to disable the functionality, set it to a unique value to enable it.
readEventstring
readEventFn(...args: any[]) => {}
readonlyboolean
resourceNamestringName of the backend resource which contain the entities to manage
searchBarConfigAvailableOption[]
selectedEntityanyReference to the currently selected entity from the grid.
sizeColumnsToFitboolean
submittingboolean
titlestringTitle of the grid
updateEventstringName of the event handler on the Genesis server which handles updating the entity
updateFormUiSchemaany

Methods

MethodModifiersDescription
closeModal()
confirmDelete()
criteriaChanged(e)
deepClone()Override the deepClone method to ensure that observable attributes are cloned
editModalVisibleChanged()
searchChanged(event)
submitEntityChanges(e)Event handler for when the user submits the action for the currently open form, either editing or adding the entity
submitFailureNotification(e)