From 4f0e555d6d545db6d98ea95dbd361d44fbda912b Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Thu, 18 Feb 2021 12:01:06 +0300 Subject: [PATCH] Make hasFilters computed --- src/components/datatable/DataTable.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index 8ed63781d..20f003c07 100755 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -1372,7 +1372,7 @@ export default { state.multiSortMeta = this.d_multiSortMeta; } - if (this.hasFilters()) { + if (this.hasFilters) { state.filters = this.filters; } @@ -1506,7 +1506,7 @@ export default { }, createLazyLoadEvent(event) { let filterMatchModes; - if (this.hasFilters()) { + if (this.hasFilters) { filterMatchModes = {}; this.columns.forEach(col => { if (col.field) { @@ -1526,9 +1526,6 @@ export default { filterMatchModes: filterMatchModes }; }, - hasFilters() { - return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object; - }, hasGlobalFilter() { return this.filters && Object.prototype.hasOwnProperty.call(this.filters, 'global'); }, @@ -1626,6 +1623,9 @@ export default { return null; }, + hasFilters() { + return this.filters && Object.keys(this.filters).length > 0 && this.filters.constructor === Object; + }, processedData() { if (this.lazy) { return this.value; @@ -1641,7 +1641,7 @@ export default { data = this.sortMultiple(data); } - if (this.hasFilters()) { + if (this.hasFilters) { data = this.filter(data); }