From 013b12693f24129b538a87cb4568f152058f4ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Fri, 18 Aug 2023 11:20:29 +0300 Subject: [PATCH] Refactor #4008 --- components/lib/datatable/DataTable.vue | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/components/lib/datatable/DataTable.vue b/components/lib/datatable/DataTable.vue index 038047327..df1b29e08 100755 --- a/components/lib/datatable/DataTable.vue +++ b/components/lib/datatable/DataTable.vue @@ -516,16 +516,15 @@ export default { } let data = [...value]; - - let lookupMap = new Map(); + let resolvedFieldDatas = new Map(); for (let item of data) { - lookupMap.set(item, ObjectUtils.resolveFieldData(item, this.d_sortField)); + resolvedFieldDatas.set(item, ObjectUtils.resolveFieldData(item, this.d_sortField)); } data.sort((data1, data2) => { - let value1 = lookupMap.get(data1); - let value2 = lookupMap.get(data2); + let value1 = resolvedFieldDatas.get(data1); + let value2 = resolvedFieldDatas.get(data2); let result = null; @@ -608,7 +607,6 @@ export default { }; const filterValidEntries = (entry) => entry !== undefined; - const entries = Object.entries(filters).map(removeEmptyFilters).filter(filterValidEntries); return Object.fromEntries(entries); @@ -618,10 +616,9 @@ export default { return; } - let activeFilters = this.getActiveFilters(this.filters); - this.clearEditingMetaData(); + let activeFilters = this.getActiveFilters(this.filters); let globalFilterFieldsArray; if (activeFilters['global']) {