From 67ace508313420c65d34d433e96fb4d5f5d8577a Mon Sep 17 00:00:00 2001 From: mertsincan Date: Wed, 9 Mar 2022 11:51:53 +0000 Subject: [PATCH] Fixed #2271 - DataTable with edit, sort and filter options does not work as expected --- src/components/datatable/DataTable.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index 3ed083ac2..d1cf28f7d 100755 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -1154,7 +1154,7 @@ export default { } ` }); - + this.styleElement.innerHTML = innerHTML; }, bindColumnResizeEvents() { @@ -1625,16 +1625,19 @@ export default { }, onEditingMetaChange(event) { let { data, field, index, editing } = event; - let meta = this.d_editingMeta[index]; + let editingMeta = { ...this.d_editingMeta }; + let meta = editingMeta[index]; if (editing) { - !meta && (meta = this.d_editingMeta[index] = { data: { ...data }, fields: [] }); + !meta && (meta = editingMeta[index] = { data: { ...data }, fields: [] }); meta['fields'].push(field); } else if (meta) { const fields = meta['fields'].filter(f => f !== field); - !fields.length ? (delete this.d_editingMeta[index]) : (meta['fields'] = fields); + !fields.length ? (delete editingMeta[index]) : (meta['fields'] = fields); } + + this.d_editingMeta = editingMeta; }, clearEditingMetaData() { if (this.editMode) {