KeyValueEditor
Defined in: packages/rxdb-model/dist/entity-table/editors/key-value-editor.d.ts:12
KeyValue(Record<string, unknown>)editor — Schema mode only
- Key is always a dropdown derived from schema definition
- Value input type adapts to the key's schema type
- Per-row inline error hints; global summary shown at bottom
- Ctrl+Enter / confirm button: validate & commit
- Escape / cancel button: revert to original value
Implements
IEditor<unknown>
Constructors
Constructor
new KeyValueEditor(schema?): KeyValueEditor;
Defined in: packages/rxdb-model/dist/entity-table/editors/key-value-editor.d.ts:21
创建 KeyValue 编辑器
Parameters
| Parameter | Type | Description |
|---|---|---|
schema? | | Record<string, KVSchemaEntry> | null | 可选的键 Schema 定义;不传或为空时进入自由模式 |
Returns
KeyValueEditor
Properties
editorType
readonly editorType: "key-value-editor" = "key-value-editor";
Defined in: packages/rxdb-model/dist/entity-table/editors/key-value-editor.d.ts:15
VTable 编辑器类型标识(注册到 VTable 的编辑器名)
Methods
getValue()
getValue(): Record<string, unknown>;
Defined in: packages/rxdb-model/dist/entity-table/editors/key-value-editor.d.ts:25
返回当前编辑的键值对象
Returns
Record<string, unknown>
Implementation of
IEditor.getValue
isEditorElement()
isEditorElement(el): boolean;
Defined in: packages/rxdb-model/dist/entity-table/editors/key-value-editor.d.ts:29
判断目标元素是否属于编辑器浮层
Parameters
| Parameter | Type |
|---|---|
el | EventTarget | HTMLElement |
Returns
boolean
Implementation of
IEditor.isEditorElement
onEnd()
onEnd(): void;
Defined in: packages/rxdb-model/dist/entity-table/editors/key-value-editor.d.ts:27
结束编辑:中止未决监听并清理浮层
Returns
void
Implementation of
IEditor.onEnd
onStart()
onStart(ctx): void;
Defined in: packages/rxdb-model/dist/entity-table/editors/key-value-editor.d.ts:23
打开编辑器:构建键值对编辑浮层并按初始值 / Schema 填充行
Parameters
| Parameter | Type |
|---|---|
ctx | EditContext<unknown> |
Returns
void
Implementation of
IEditor.onStart