fk editor

This commit is contained in:
Jan Prochazka
2021-06-24 11:42:26 +02:00
parent 4db464772e
commit 8f3c479642
2 changed files with 35 additions and 9 deletions

View File

@@ -71,10 +71,13 @@
<SelectField
value={column.columnName}
isNative
options={tableInfo.columns.map(col => ({
label: col.columnName,
value: col.columnName,
}))}
options={[
{ label: '(Not selected)', value: '' },
...tableInfo.columns.map(col => ({
label: col.columnName,
value: col.columnName,
})),
]}
on:change={e => {
if (e.detail) {
columns = columns.map((col, i) => (i == index ? { ...col, columnName: e.detail } : col));
@@ -88,10 +91,13 @@
<SelectField
value={column.refColumnName}
isNative
options={(refTableInfo?.columns || []).map(col => ({
label: col.columnName,
value: col.columnName,
}))}
options={[
{ label: '(Not selected)', value: '' },
...(refTableInfo?.columns || []).map(col => ({
label: col.columnName,
value: col.columnName,
})),
]}
on:change={e => {
if (e.detail) {
columns = columns.map((col, i) => (i == index ? { ...col, refColumnName: e.detail } : col));