+
({
@@ -286,9 +304,11 @@ export default {
}
},
async reload() {
- const id = this.meta.columns.filter((c) => c.pk).map(c => this.localState[c._cn]).join('___');
+ // const id = this.meta.columns.filter((c) => c.pk).map(c => this.localState[c._cn]).join('___');
+ const where = this.meta.columns.filter((c) => c.pk).map(c => `(${c._cn},eq,${this.localState[c._cn]})`).join('');
this.$set(this, 'changedColumns', {});
- this.localState = await this.api.read(id);
+ // this.localState = await this.api.read(id);
+ this.localState = (await this.api.list({...(this.queryParams || {}), where}) || [{}])[0];
if (!this.isNew && this.toggleDrawer) {
this.getAuditsAndComments()
}
@@ -320,6 +340,7 @@ export default {
return !!Object.keys(this.changedColumns).length;
},
fields() {
+ if (this.availableColumns) return this.availableColumns;
const hideCols = ['created_at', 'updated_at'];
diff --git a/packages/nc-gui/components/project/spreadsheet/components/virtualCell.vue b/packages/nc-gui/components/project/spreadsheet/components/virtualCell.vue
index 0b34d10d25..f7ffad1458 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/virtualCell.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/virtualCell.vue
@@ -38,13 +38,17 @@
diff --git a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
index d3a8fd5a68..641ef620b3 100644
--- a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
+++ b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
@@ -409,6 +409,9 @@
:primary-value-column="primaryValueColumn"
:api="api"
@commented="reloadComments"
+ :availableColumns="availableColumns"
+ :nodes="nodes"
+ :queryParams="queryParams"
>