Class CrudObjectEdit<T>

Edit dialog (<dialog> with one form) for an object: one input per property, nested objects flattened (address.city), the id property (idKey) is not editable.

  • Works on a deep copy – the object passed in is not changed.
  • Values keep their type: numbers stay numbers (an empty number field becomes null), booleans are checkboxes (unchecking saves false), null/undefined stay as they are while their text field is left empty.
  • Labels and values are escaped – data is shown as text, never as markup.
  • Save calls onSave(editedCopy); Save, Cancel and Escape close and remove the dialog.

Example

new CrudObjectEdit('id', { id: 7, name: 'Ada', age: 36, vip: true }, 'Edit customer')
.openDialog(updated => console.info(updated)); // { id: 7, name: '…', age: 37, vip: false }

Type Parameters

  • T extends Record<string, any>

Hierarchy

  • CrudObjectEdit

Constructors

Properties

Methods

Constructors

Properties

dialogTitle: string = 'Edit Item'
direction?: "ltr" | "rtl"

Writing direction of the dialog (dir) – the CRUD factory sets the direction of the table.

Since

1.1.98

Methods