diff --git a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/hasManyCell.vue b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/hasManyCell.vue index 489c904d7c..43cbf9a830 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/hasManyCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/hasManyCell.vue @@ -350,6 +350,7 @@ export default { if (this.isNew && this.localState.every(it => it[this.childForeignKey] !== child[this.childPrimaryKey])) { this.localState.push(child) this.$emit('update:localState', [...this.localState]) + this.$emit('saveRow') this.newRecordModal = false return } @@ -394,7 +395,7 @@ export default { }, getCellValue(cellObj) { if (cellObj) { - if (this.parentMeta && this.childPrimaryCol) { + if (this.childMeta && this.childPrimaryCol) { return cellObj[this.childPrimaryCol] } return Object.values(cellObj)[1] diff --git a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/manyToManyCell.vue b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/manyToManyCell.vue index 927ee26260..318765ad5d 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/manyToManyCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/manyToManyCell.vue @@ -385,6 +385,7 @@ export default { if (this.isNew && this.localState.every(it => it[this.childForeignKey] !== child[this.childPrimaryKey])) { this.localState.push(child) this.$emit('update:localState', [...this.localState]) + this.$emit('saveRow') this.newRecordModal = false return } diff --git a/packages/nc-gui/components/project/spreadsheet/views/xcGridView.vue b/packages/nc-gui/components/project/spreadsheet/views/xcGridView.vue index e1977f58f3..2d5a442896 100644 --- a/packages/nc-gui/components/project/spreadsheet/views/xcGridView.vue +++ b/packages/nc-gui/components/project/spreadsheet/views/xcGridView.vue @@ -185,6 +185,7 @@ :is-new="rowMeta.new" v-on="$listeners" @updateCol="(...args) => updateCol(...args, columnObj.bt && meta.columns.find( c => c.cn === columnObj.bt.cn), col, row)" + @saveRow="onCellValueChange(col, row, columnObj)" />