TCB Dialog Update

The CmsDialogUpdateComponent is designed to handle updating existing entities within a modal dialog. It integrates with the CmsService to fetch the entity's current data, build dynamic forms for updates, and submit changes.

This component is flexible and supports features like dynamic form generation, null value removal, and FormData transformations, making it highly extensible for various use cases.

How to use the component in your app :

  1. import the component :

import {CmsDialogUpdateComponent} from '@tradinos/cms-frontend-entity';
  1. The selector for component , like it :

<lib-cms-dialog-update></lib-cms-dialog-update>

Features

  1. Dynamic Form Building:

    • Integrates with GenericFormBuilderComponent to generate forms based on a schema.

  2. Data Fetching:

    • Optionally fetches the entity's data for pre-filling the form.

  3. Data Transformation:

    • Removes null values or converts data to FormData before submission, based on the schema configuration.

  4. Dialog Management:

    • Opens and closes the update dialog, optionally returning the updated entity.

  5. Extensibility:

    • Works seamlessly with the CmsService for API interactions and data handling.

Dynamic Properties

These properties are dynamically set based on the passed configuration:

Property

Type

Description

Set By

item

T

The entity's data, either fetched dynamically or passed directly through config.data.item.

Dialog config or API

loading

boolean

Indicates whether the entity's data is still loading.

Internal Logic

genericFormBuilder

GenericFormBuilderComponent<T>

A dynamically built form instance tied to the entity's data.

Component Reference

Last updated