浏览代码

Added accent normalization for the filter-control extension (#6257)

Dustin Utecht 3 年之前
父节点
当前提交
7b930f8a05
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/extensions/filter-control/bootstrap-table-filter-control.js

+ 5 - 1
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -217,10 +217,14 @@ $.BootstrapTable = class extends $.BootstrapTable {
         keys.forEach(key => {
           const thisColumn = that.columns[that.fieldsColumnsIndex[key]]
           const rawFilterValue = (filterPartial[key] || '')
-          const filterValue = rawFilterValue.toLowerCase()
+          let filterValue = rawFilterValue.toLowerCase()
           let value = Utils.unescapeHTML(Utils.getItemField(item, key, false))
           let tmpItemIsExpected
 
+          if (this.options.searchAccentNeutralise) {
+            filterValue = Utils.normalizeAccent(filterValue)
+          }
+
           if (filterValue === '') {
             tmpItemIsExpected = true
           } else {