Browse Source

Improving extension

djhvscf 4 years ago
parent
commit
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()
     } else if (column.filterStartsWithSearch) {
       tmpItemIsExpected = (`${value}`).toLowerCase().indexOf(searchValue) === 0
+    } else if (column.filterControl === 'datepicker') {
+      tmpItemIsExpected = new Date(value) === new Date(searchValue)
     } else {
       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.
-    if (!column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
+    if (column.filterControl && '' !== column.filterDefault && 'undefined' !== typeof column.filterDefault) {
       if ($.isEmptyObject(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()
     }