Browse Source

added the searchable columns options to the query params for server side
pagination

NAME 5 years ago
parent
commit
dd68ecc910
1 changed files with 9 additions and 0 deletions
  1. 9 0
      src/bootstrap-table.js

+ 9 - 0
src/bootstrap-table.js

@@ -1653,6 +1653,15 @@ class BootstrapTable {
       }
     }
 
+    if (this.options.search && this.options.sidePagination === 'server') {
+      params.searchable = []
+      for (const column of this.columns) {
+        if (!column.checkbox && column.searchable && ((this.options.visibleSearch && column.visible) || !this.options.visibleSearch)) {
+          params.searchable.push(column.field)
+        }
+      }
+    }
+
     if (!(Utils.isEmptyObject(this.filterColumnsPartial))) {
       params.filter = JSON.stringify(this.filterColumnsPartial, null)
     }