浏览代码

Improving extension

djhvscf 4 年之前
父节点
当前提交
da0db68a97

+ 2 - 0
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -255,6 +255,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
       tmpItemIsExpected = value.toString().toLowerCase() === searchValue.toString().toLowerCase()
       tmpItemIsExpected = value.toString().toLowerCase() === searchValue.toString().toLowerCase()
     } else if (column.filterStartsWithSearch) {
     } else if (column.filterStartsWithSearch) {
       tmpItemIsExpected = (`${value}`).toLowerCase().indexOf(searchValue) === 0
       tmpItemIsExpected = (`${value}`).toLowerCase().indexOf(searchValue) === 0
+    } else if (column.filterControl === 'datepicker') {
+      tmpItemIsExpected = new Date(value) === new Date(searchValue)
     } else {
     } else {
       tmpItemIsExpected = (`${value}`).toLowerCase().includes(searchValue)
       tmpItemIsExpected = (`${value}`).toLowerCase().includes(searchValue)
     }
     }

+ 2 - 2
src/extensions/filter-control/utils.js

@@ -360,7 +360,7 @@ export function createControls (that, header) {
     }
     }
 
 
     // Filtering by default when it is set.
     // Filtering by default when it is set.
-    if (!column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
+    if (column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
       if ($.isEmptyObject(that.filterColumnsPartial)) {
       if ($.isEmptyObject(that.filterColumnsPartial)) {
         that.filterColumnsPartial = {}
         that.filterColumnsPartial = {}
       }
       }
@@ -501,7 +501,7 @@ export function createControls (that, header) {
       })
       })
     }
     }
 
 
-    if (that.options.sidePagination !== 'server' && !that.options.height) {
+    if (that.options.sidePagination !== 'server') {
       that.triggerSearch()
       that.triggerSearch()
     }
     }