From 1e56e62f408d6d051a4badca334f4b2f3245c480 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Wed, 23 Sep 2020 22:20:09 +0300 Subject: [PATCH] Fixed filtering --- src/components/datatable/DataTable.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/datatable/DataTable.vue b/src/components/datatable/DataTable.vue index efa96f872..f631b3bcc 100755 --- a/src/components/datatable/DataTable.vue +++ b/src/components/datatable/DataTable.vue @@ -597,7 +597,7 @@ export default { if (Object.prototype.hasOwnProperty.call(this.filters, columnField)) { let filterValue = this.filters[columnField]; let dataFieldValue = ObjectUtils.resolveFieldData(data[i], columnField); - let filterConstraint = col.props.filterMatchMode === 'custom' ? col.props.filterFunction : FilterUtils[col.props.filterMatchMode]; + let filterConstraint = col.props.filterMatchMode === 'custom' ? col.props.filterFunction : FilterUtils[col.props.filterMatchMode||'startsWith']; if (!filterConstraint(dataFieldValue, filterValue, this.filterLocale)) { localMatch = false; } @@ -613,11 +613,11 @@ export default { } let matches = localMatch; - if(this.hasGlobalFilter) { + if (this.hasGlobalFilter) { matches = localMatch && globalMatch; } - if(matches) { + if (matches) { filteredValue.push(data[i]); } }