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 |
|---|---|---|---|
|
ColDef[] |
Array which holds the column definitions. | ||
|
string |
Optional confirmation message to display before form submission. If set, a confirmation dialog will be shown when the user clicks submit. | ||
|
string |
Name of the event handler on the Genesis server which handles creating an entity | ||
|
UiSchema |
Enables you to supply a schema to configure an insert form. | ||
|
string |
The label of the crud action menu | ||
|
Determines where the buttons will appear | |||
|
Determines the style of the buttons | |||
|
Array of custom actions that can be added to the entity management component | |||
|
Get the configuration which is used when interacting with the resource on the backend | |||
|
DatasourceType |
If set to 'server' it will enable Server-Side Row Model and use | ||
|
Record<string, unknown> |
The default values to populate the form with when the user is adding an entity | ||
|
string |
Name of the event handler on the Genesis server which handles deleting the entity | ||
|
boolean |
If false, will disable cell flashing for all cells by default, unless otherwise defined in custom colDef | ||
|
{ buttonName?: string; fileName?: string; } | null |
Enabling this option will enable a download button in the top-right of the header which will export the data to a csv file when clicked. | ||
|
boolean |
Enables filter bar component | ||
|
boolean |
If true, will enable row flashing for all rows for | ||
|
boolean |
This attribute controls whether to enable the search-bar. | ||
|
string |
Label for the entity which is used in the title of the modal when editing the entity, on CRUD buttons and on toast notifications | ||
|
RendererEntry[] |
Array with renderers used by foundation-forms | ||
|
boolean |
Controls automatic column sizing on interaction. Disables manual column widths and local storage persistence of widths. | ||
|
GridOptions |
GridOptions to be passed down from application | ||
|
GridProCaseType |
The case type to use for the header names. If not set, the default CONSTANT_CASE will be used. | ||
|
boolean |
Hides delete button | ||
|
boolean |
Hides edit button | ||
|
'centre' | 'left' | 'right' |
Determines where the modal dialog will appear on screen | ||
|
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. | ||
|
string |
The key to use for persisting the filter model in local browser or KV storage. | ||
|
string |
Name of the design system prefix that will be used in renderers. | ||
|
string |
Name of the request on the Genesis server which fetches data for the form, example usage could include fetching additional data that is not available in the grid but required for the selected entity | ||
|
(entity: any) => any |
Similar to readEvent but allows to provide function that will be executed before opening the form and yields data to the form | ||
|
string |
Name of the backend resource which contain the entities to manage | ||
|
string |
This attribute allows you to change row-selection to 'single' or 'multiple' which will allow you to select single or multiple rows. | ||
|
AvailableOption[] |
Allows configuration of the search bar component, if not provided it would build configuration based on columns in the grid * | ||
|
boolean |
Auto-sizes a column based on its contents | ||
|
boolean |
Resizes columns to take available space | ||
|
GridProStatusBarConfig |
Configuration for the grid status bar components. | ||
|
string |
Title of the grid | ||
|
string |
Name of the event handler on the Genesis server which handles updating the entity | ||
|
UiSchema |
Enables you to supply a schema to configure an update form. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Deletes the saved column state for the grid | ||
|
Usually when the datasource config is updated we need to cache the criteria so it can be combined with the searchbar, but this function allows you to set the datasource config without doing that (so we don't cache the search bar criteria) |