diff --git a/packages/nc-gui/components/virtual-cell/HasMany.vue b/packages/nc-gui/components/virtual-cell/HasMany.vue index fe43c2b03f..e033bf5854 100644 --- a/packages/nc-gui/components/virtual-cell/HasMany.vue +++ b/packages/nc-gui/components/virtual-cell/HasMany.vue @@ -40,7 +40,7 @@ const { isUIAllowed } = useUIPermission() const { state, isNew, removeLTARRef } = useSmartsheetRowStoreOrThrow() -const { loadRelatedTableMeta, relatedTableDisplayValueProp, unlink } = useProvideLTARStore( +const { relatedTableMeta, loadRelatedTableMeta, relatedTableDisplayValueProp, unlink } = useProvideLTARStore( column as Ref>, row, isNew, @@ -78,6 +78,11 @@ const unlinkRef = async (rec: Record) => { } } +const hasManyColumn = computed( + () => + relatedTableMeta.value?.columns?.find((c: any) => c.title === relatedTableDisplayValueProp.value) as ColumnType | undefined, +) + const onAttachRecord = () => { childListDlg.value = false listItemsDlg.value = true @@ -103,6 +108,7 @@ useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEven :key="i" :item="cell.item" :value="cell.value" + :column="hasManyColumn" @unlink="unlinkRef(cell.item)" />