Browse Source

fixed paginationSwitch for server-side #1677

as see in #1677, server-side didnt check against this.options.pagination, so pagination-switch became ignored unless crude queryParam workaround
dabros 10 years ago
parent
commit
686ca3acda
1 changed files with 9 additions and 5 deletions
  1. 9 5
      src/bootstrap-table.js

+ 9 - 5
src/bootstrap-table.js

@@ -1742,16 +1742,20 @@
     BootstrapTable.prototype.initServer = function (silent, query) {
         var that = this,
             data = {},
-            params = {
-                pageSize: this.options.pageSize === this.options.formatAllRows() ?
-                    this.options.totalRows : this.options.pageSize,
-                pageNumber: this.options.pageNumber,
+            params = {                
                 searchText: this.searchText,
                 sortName: this.options.sortName,
                 sortOrder: this.options.sortOrder
             },
             request;
 
+        if(this.options.pagination)
+        {
+        	params.pageSize = this.options.pageSize === this.options.formatAllRows() ?
+                    this.options.totalRows : this.options.pageSize;
+            params.pageNumber = this.options.pageNumber;
+        }
+
         if (!this.options.url && !this.options.ajax) {
             return;
         }
@@ -2732,4 +2736,4 @@
     $(function () {
         $('[data-toggle="table"]').bootstrapTable();
     });
-}(jQuery);
+}(jQuery);