浏览代码

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

NAME 5 年之前
父节点
当前提交
dd68ecc910
共有 1 个文件被更改,包括 9 次插入0 次删除
  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)
     }