Skip to content

Remote Lookup Editor

Double-click a value to edit. Selecting a single record saves automatically. For multiple selection, finish with Ctrl/Cmd+Enter or click outside. Escape discards the draft. Read-only cells cannot open or commit an editor.

Set lookup.autoApply: false to keep drafts until explicit Apply and show Apply/Cancel controls. Set lookup.showActions: true to show those controls while retaining automatic saves; showActions: false hides them. Clear remains available for optional values.

Source code
<template>
<p>
Double-click to edit. Valid changes save automatically; Escape discards the
draft.
</p>
<RevoGrid
:source="source"
:columns="columns"
:plugins="plugins"
:theme="isDark ? 'darkMaterial' : 'material'"
style="height: 340px"
/>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { currentThemeVue } from '../composables/useRandomData';
import RevoGrid from '@revolist/vue3-datagrid';
import { editorColumns, editorRows } from './editor-data';
const { isDark } = currentThemeVue();
const source = ref(editorRows());
const columns = editorColumns();
const plugins = [];
</script>

Use LookupEditor to select existing records through application-owned asynchronous search and resolve callbacks. Store stable string or number IDs; labels and display metadata stay in options. Single selection clears to null; multiple selection clears to [].

Search debounces for 200 ms and requests 50 options per page. Results retain server ordering, load more pages on scrolling, abort obsolete requests and ignore stale responses. Saved IDs resolve separately; missing records remain visible as unavailable IDs. Selected chips persist across searches and pages. Loading, failure, retry and empty-state text can be localized through lookup.text.

Configure lookup.multiple, required, placeholder, context, source seed options, and renderOption/renderValue. A context callback receives the cell, so applications can scope requests by row or account. Applications own backend access and authorization; the editor does not create records.

Localize loading, empty, retry, error and unresolved-record text through lookup.text. The same object accepts popupLabel, label, placeholder, searchPlaceholder, searchLabel and removeLabel(label) for selection controls and chips. Partial lookup.actions overrides Apply, Cancel and Clear. Backend callbacks own authorization and data access; translations do not change stable record IDs.