Editor / DOM Helper / initEditableList
Function: initEditableList()
ts
function initEditableList<T>(params): void;Turns an <ol> into a Node-RED editableList (rows that can be added, removed and sorted).
The widget sizes its box once, for an empty list: the helper makes it follow the height of its rows when they are added or removed.
Type Parameters
| Type Parameter | Default type |
|---|---|
|
Parameters
| Parameter | Type | Description |
|---|---|---|
| See EditableListParams. |
Returns
void
Example
typescript
// pug: +dxpFormRowEditableList({ id: 'rules', label: 'Rules' })
initEditableList<Rule>({
selector: '$rules-container',
items: this.rules,
addItem: (row, rule) => {
$('<input type="text">').appendTo(row).val(rule.name ?? '');
},
});