Entity Manager declarative HTML
The Declarative HTML API enables you to use simple, semantic tags to create and configure the entity-management component directly within your HTML. You can quickly integrate and easily customize the component without writing complex JavaScript code.
Using HTML attributes, you can define key settings such as the data source, event handlers, UI schema, and actions like create, update, and delete, all within the markup itself.
Entity Management
Top-level web component, which is used to initialize the entity-management.
<entity-management></entity-management>
DOM API
Property and attribute binding examples for Genesis Component syntax. Closing tag omitted.
Attributes
Attribute | Type | Use | Example |
---|---|---|---|
design-system-prefix | string | Name of the design system prefix that will be used in renderers. |
|
resourceName | string | Name of the backend resource which contains the entities to manage. |
|
updateEvent | string | Name of the event handler on the Genesis server for updating the entity. |
|
deleteEvent | string | Name of the event handler on the Genesis server for deleting the entity. |
|
createEvent | string | Name of the event handler on the Genesis server for creating a new entity. |
|
title | string | Title of the grid. |
|
entityLabel | string | Label for the entity, used in modal titles, buttons, and notifications. |
|
readEvent | string | Name of the request on the Genesis server to fetch data for the form. |
|
row-selection | string | Allows single or multiple row selection; values: 'single' or 'multiple'. |
|
enable-cell-flashing | boolean | Enables or disables cell flashing for updates; defaults to true . |
|
enable-row-flashing | boolean | Enables or disables row flashing for add transactions; defaults to false . |
|
datasource-type | DatasourceType | Sets the datasource type: 'server' or 'client'. |
|
persist-column-state-key | string | Unique key for storing column state persistently; omit to disable. |
|
size-columns-to-fit | boolean | Automatically resizes columns to fit the available space. |
|
enable-filter-bar | boolean | Enables or disables the filter bar component. |
|
hide-edit | boolean | Hides the edit button; defaults to false . |
|
hide-delete | boolean | Hides the delete button; defaults to false . |
|
enable-search-bar | boolean | Enables or disables the search bar component. |
|
header-case-type | GridProCaseType | Sets the header case type; defaults to 'CONSTANT_CASE'. |
|
modal-position | 'centre' | 'left' | 'right' | Specifies where the modal dialog will appear. |
|
crud-menu-position | CrudMenuPosition | Determines where CRUD menu buttons appear. |
|
crud-menu-style | ActionsMenuStyle | Sets the style of the CRUD menu buttons. |
|
crud-action-menu-name | string | Sets the label of the CRUD action menu. |
|
Properties
Property | Type | Use | Example |
---|---|---|---|
readEventFn | (entity) => any | Function triggered when an event is read from the entity management. |
|
gridOptions | GridOptions | Additional configuration options for the grid, such as pagination or sorting. |
|
columns | ColDef[] | Defines the column configuration, including headers and field mappings. |
|
datasourceConfig | DatasourceConfiguration | Specifies the configuration for the data source, including API endpoints. |
|
createFormUiSchema | UiSchema | Defines the UI schema for the create entity form. |
|
updateFormUiSchema | UiSchema | Defines the UI schema for the update entity form. |
|
formRenderers | RendererEntry[] | Custom renderers for specific form fields. |
|
defaultEntityValues | Record<string, unknown> | Default values to populate in forms when creating a new entity. |
|
searchBarConfig | AvailableOption[] | Configuration for the search bar, such as placeholder text and debounce time. |
|
Slots
Slot | Use |
---|---|
header | The content to be displayed in the header section. If crud-menu-position is set to top , this slot content will overwrite the crud-top content. |
footer | The content to be displayed in the footer section. If crud-menu-position is set to bottom , this slot content will overwrite the crud-bottom content. |
edit | Using this slot enables you to override the default form component. |
crud-{position}-before | Based on value from crud-menu-position the content will be displayed before the specified position. |
crud-{position} | Based on value from crud-menu-position will be displayed in the specified position. |
crud-{position}-after | Based on value from crud-menu-position the content will be displayed after the specified position. |
Parts
Part | Use |
---|---|
header | Using this part allows you to customize the styles for the header section of the entity management component, which can include the title, search-bar, or other header-related elements. |
form | Using this part enables you to modify the foundation-form styling. |
crud-buttons-wrapper crud-buttons-wrapper-column crud-buttons-wrapper-${position} | These parts allow you to style the wrapper container of the CRUD buttons. The ${position} part can be dynamically replaced to target the position-specific button wrappers. |
crud-buttons crud-buttons-${position} | Using these parts allows you to style the individual CRUD buttons. The ${position} part targets specific button groups to customize the placement and appearance. |
Fired events
Events can be received by the emitting <entity-management>
, or any parent element.
Event | Type | Use | Example |
---|---|---|---|
rowSelected | CustomEvent | Triggered when a row is selected. |
|
selectionChanged | CustomEvent | Triggered when the selection in the grid changes. |
|
rowClick | CustomEvent | Triggered when a row is clicked. |
|
rowDblClick | CustomEvent | Triggered when a row is double-clicked. |
|
contextMenu | CustomEvent | Triggered when a context menu is opened on a row. |
|
submit-success | CustomEvent<{ payload: any } | Triggered when the form submission is successful. |
|
submit-failure | CustomEvent<{ payload: any; errors: MessageError[] }> | Triggered when the form submission fails. |
|
request-changed | CustomEvent | Triggered when the request is changed. |
|
criteria-changed | CustomEvent | Triggered when the form criteria is changed. |
|
Listened events
This component doesn't listen to any public API events.