diff --git a/client/components/open/forms/components/FormSubmissions.vue b/client/components/open/forms/components/FormSubmissions.vue index 08b42db..63ee58b 100644 --- a/client/components/open/forms/components/FormSubmissions.vue +++ b/client/components/open/forms/components/FormSubmissions.vue @@ -19,12 +19,12 @@
{{ field.name }}
@@ -77,10 +77,12 @@{{ col.name }} @@ -36,16 +36,16 @@ class="action-row absolute w-full" style="will-change: transform; transform: translate3d(0px, 32px, 0px)" > -
No data found. @@ -92,6 +92,10 @@ import {hash} from "~/lib/utils.js"; export default { components: { ResizableTh, RecordOperations }, props: { + columns: { + type: Array, + default: () => [] + }, data: { type: Array, default: () => [] @@ -153,7 +157,7 @@ export default { }, watch: { - 'form.properties': { + 'columns': { handler () { this.onStructureChange() }, @@ -212,11 +216,11 @@ export default { return [colAlign, colColor, colWrap, colFontWeight] }, onStructureChange () { - if (this.form && this.form.properties) { + if (this.columns) { this.$nextTick(() => { - this.form.properties.forEach(col => { + this.columns.forEach(col => { if (!col.hasOwnProperty('cell_width')) { - if (this.allowResize && this.form !== null && document.getElementById('table-head-cell-' + col.id)) { + if (this.allowResize && this.columns.length && document.getElementById('table-head-cell-' + col.id)) { // Within editor this.resizeCol(col, document.getElementById('table-head-cell-' + col.id).offsetWidth) } @@ -227,10 +231,10 @@ export default { }, resizeCol (col, width) { if (!this.form) return - const columns = clonedeep(this.form.properties) - const index = this.form.properties.findIndex(c => c.id === col.id) + const columns = clonedeep(this.columns) + const index = this.columns.findIndex(c => c.id === col.id) columns[index].cell_width = width - this.form.properties = columns + this.setColumns(columns) this.$nextTick(() => { this.$emit('resize') }) @@ -263,6 +267,9 @@ export default { } } } + }, + setColumns(val) { + this.$emit('update-columns',val) } } }