Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/shared/components/ncTable/sections/CustomTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export default {
width: 55px;
background-color: inherit;
padding-inline-end: 16px;
z-index: 5;
}

tr>td.sticky:last-child {
Expand Down
11 changes: 9 additions & 2 deletions src/store/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ export const useDataStore = defineStore('data', {
const stateId = genStateKey(isView, elementId)
if (stateId && this.rows[stateId]) {
const row = res.data
const index = this.rows[stateId].findIndex(r => r.id === row.id)
set(this.rows[stateId], index, row)
const updatedRows = this.rows[stateId].map(r => r.id === row.id ? row : r)
set(this.rows, stateId, updatedRows)
await this.removeRowIfNotInView({ rowId: row?.id, viewId, stateId })
}

Expand Down Expand Up @@ -380,6 +380,13 @@ export const useDataStore = defineStore('data', {
this.rows[stateId] = this.rows[stateId].filter(r => r.id !== rowId)
}
},

seedRows({ isView, elementId, rows }) {
const stateId = genStateKey(isView, elementId)
if (stateId) {
set(this.rows, stateId, rows)
}
},
},

})
7 changes: 7 additions & 0 deletions src/views/ContentReferenceWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<NcTable
:rows="filteredRows"
:columns="richObject.columns"
:element-id="richObject.id"
:is-view="Boolean(richObject.type)"
v-bind="tablePermissions"
@edit-row="editRow"
@copy-row="copyRow"
Expand Down Expand Up @@ -222,6 +224,11 @@ export default {

if (this.richObject.rows) {
this.localRows = this.richObject.rows
this.dataStore.seedRows({
isView: Boolean(this.richObject.type),
elementId: this.richObject.id,
rows: this.richObject.rows,
})
return
}

Expand Down
Loading