浏览代码

Merge pull request #2517 from Flounn/patch-1

Update to work with sidePagination and sideSort on the server
Dennis Hernández 8 年之前
父节点
当前提交
a91c3804c1
共有 1 个文件被更改,包括 11 次插入4 次删除
  1. 11 4
      src/extensions/multiple-sort/bootstrap-table-multiple-sort.js

+ 11 - 4
src/extensions/multiple-sort/bootstrap-table-multiple-sort.js

@@ -123,16 +123,15 @@
                     that.options.sortName = '';
 
                     if (that.options.sidePagination === 'server') {
-
+                        var t = that.options.queryParams;
                         that.options.queryParams = function(params) {
                             params.multiSort = that.options.sortPriority;
-                            return params;
+                            return t(params);
                         };
-
+                        isSingleSort=false;
                         that.initServer(that.options.silentSort);
                         return;
                     }
-
                     that.onMultipleSort();
 
                 }
@@ -238,6 +237,14 @@
         this.sortModalSelector = sortModalSelector;
 
         _initToolbar.apply(this, Array.prototype.slice.apply(arguments));
+        
+        if (that.options.sidePagination === 'server' && !isSingleSort && that.options.sortPriority !== null){
+            var t = that.options.queryParams;
+            that.options.queryParams = function(params) {
+                params.multiSort = that.options.sortPriority;
+                return t(params);
+            };
+        }
 
         if (this.options.showMultiSort) {
             var $btnGroup = this.$toolbar.find('>.btn-group').first(),