Fixed #2271 - DataTable with edit, sort and filter options does not work as expected

pull/2272/head
mertsincan 2022-03-09 11:51:53 +00:00
parent 5323655dd1
commit 67ace50831
1 changed files with 7 additions and 4 deletions

View File

@ -1154,7 +1154,7 @@ export default {
} }
` `
}); });
this.styleElement.innerHTML = innerHTML; this.styleElement.innerHTML = innerHTML;
}, },
bindColumnResizeEvents() { bindColumnResizeEvents() {
@ -1625,16 +1625,19 @@ export default {
}, },
onEditingMetaChange(event) { onEditingMetaChange(event) {
let { data, field, index, editing } = event; let { data, field, index, editing } = event;
let meta = this.d_editingMeta[index]; let editingMeta = { ...this.d_editingMeta };
let meta = editingMeta[index];
if (editing) { if (editing) {
!meta && (meta = this.d_editingMeta[index] = { data: { ...data }, fields: [] }); !meta && (meta = editingMeta[index] = { data: { ...data }, fields: [] });
meta['fields'].push(field); meta['fields'].push(field);
} }
else if (meta) { else if (meta) {
const fields = meta['fields'].filter(f => f !== field); 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() { clearEditingMetaData() {
if (this.editMode) { if (this.editMode) {