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
Property | Modifiers | Type | Description |
---|---|---|---|
asyncAdd | boolean | Whether to use the applyTransactionAsync function for *add* transactions | |
asyncRemove | boolean | Whether to use the applyTransactionAsync function for *remove* transactions | |
asyncUpdate | boolean | Whether to use the applyTransactionAsync function for *update* transactions | |
columns | ColDef[] | Array which holds the column definitions. | |
connect | protected | Connect | DI connect object which is used to interact with the backend. |
createEvent | string | Name of the event handler on the Genesis server which handles creating an entity | |
createFormUiSchema | any | ||
datasourceConfig | DatasourceConfiguration | The configuration which is used when interacting with the resource on the backend | |
defaultEntityValues | any | ||
deleteEvent | string | Name of the event handler on the Genesis server which handles deleting the entity | |
editDialogTitle | string | String which contains the text of the popup modal when the user is adding or editing an entity | |
editedEntity | any | Disables the form while enabled to stop the user dispatching a large number of duplicate events | |
editEntityModal | any | ||
editModalVisible | boolean | ||
enableCellFlashing | boolean | If false, will disable cell flashing for all cells by default, unless otherwise defined in custom colDef | |
enableFilterBar | boolean | ||
enableRowFlashing | boolean | If true, will enable row flashing for all rows for add transactions | |
enableSearchBar | boolean | ||
entityLabel | string | Label for the entity which has usages such as being shown in the title of the modal wen editing the entity | |
formRenderers | RendererEntry[] | Array with renderers used by foundation-forms | |
formUiSchema | any | ||
gridOptions | GridOptions | GridOptions to be passed down from application | |
headerCaseType | GridProCaseType | The case type to use for the header names. If not set, the default CONSTANT_CASE will be used. | |
headerTempalate | readonly | import("@microsoft/fast-element").ViewTemplate<EntityManagement, any> | |
hideDelete | boolean | ||
hideEdit | boolean | ||
modalPosition | 'centre' | 'left' | 'right' | Determines where the modal dialog will appear on screen | |
persistColumnStateKey | string | This 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. | |
readEvent | string | ||
readEventFn | (...args: any[]) => {} | ||
readonly | boolean | ||
resourceName | string | Name of the backend resource which contain the entities to manage | |
searchBarConfig | AvailableOption[] | ||
selectedEntity | any | Reference to the currently selected entity from the grid. | |
sizeColumnsToFit | boolean | ||
submitting | boolean | ||
title | string | Title of the grid | |
updateEvent | string | Name of the event handler on the Genesis server which handles updating the entity | |
updateFormUiSchema | any |
Methods
Method | Modifiers | Description |
---|---|---|
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) |