diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue index 4331ac931d..52db90f92b 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue @@ -51,6 +51,7 @@ interface Props { lastRow?: boolean closeAfterSave?: boolean newRecordHeader?: string + skipReload?: boolean } const props = defineProps() @@ -102,7 +103,7 @@ const expandedFormScrollWrapper = ref() const reloadTrigger = inject(ReloadRowDataHookInj, createEventHook()) -const reloadViewDataTrigger = inject(ReloadViewDataHookInj) +const reloadViewDataTrigger = inject(ReloadViewDataHookInj, createEventHook()) const { addOrEditStackRow } = useKanbanViewStoreOrThrow() @@ -218,16 +219,18 @@ const save = async () => { await _save(rowState.value, undefined, { kanbanClbk, }) - reloadTrigger?.trigger() - reloadViewDataTrigger?.trigger() } else { await _save(undefined, undefined, { kanbanClbk, }) _loadRow() + } + + if (!props.skipReload) { reloadTrigger?.trigger() reloadViewDataTrigger?.trigger() } + isUnsavedFormExist.value = false if (props.closeAfterSave) { diff --git a/packages/nc-gui/components/virtual-cell/components/UnLinkedItems.vue b/packages/nc-gui/components/virtual-cell/components/UnLinkedItems.vue index 796921030a..5f79a4462f 100644 --- a/packages/nc-gui/components/virtual-cell/components/UnLinkedItems.vue +++ b/packages/nc-gui/components/virtual-cell/components/UnLinkedItems.vue @@ -66,6 +66,10 @@ const isForm = inject(IsFormInj, ref(false)) const saveRow = inject(SaveRowInj, () => {}) +const reloadTrigger = inject(ReloadRowDataHookInj, createEventHook()) + +const reloadViewDataTrigger = inject(ReloadViewDataHookInj, createEventHook()) + const linkRow = async (row: Record, id: number) => { if (isNew.value) { addLTARRef(row, injectedColumn?.value as ColumnType) @@ -199,6 +203,13 @@ const onCreatedRecord = (record: any) => { addLTARRef(record, injectedColumn?.value as ColumnType) saveRow!() + reloadTrigger?.trigger({ + shouldShowLoading: false, + }) + reloadViewDataTrigger?.trigger({ + shouldShowLoading: false, + }) + const msgVNode = h( 'div', { @@ -448,6 +459,7 @@ const onFilterChange = () => { :row-id="extractPkFromRow(expandedFormRow, relatedTableMeta.columns as ColumnType[])" :state="newRowState" use-meta-fields + :skip-reload="true" @created-record="onCreatedRecord" />