浏览代码

Fix condition to add levels in showSortModal

dimbslmh 10 年之前
父节点
当前提交
f790c793c1
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/extensions/multiple-sort/bootstrap-table-multiple-sort.js

+ 5 - 3
src/extensions/multiple-sort/bootstrap-table-multiple-sort.js

@@ -141,9 +141,11 @@
                 }
                 }
             }
             }
             
             
-            if ($rows.length < that.options.sortPriority.length && typeof that.options.sortPriority === 'object') {
-                for (var i = 0; i < that.options.sortPriority.length; i++) {
-                    that.addLevel(i, that.options.sortPriority[i]);
+            if (that.options.sortPriority !== null) {
+                if ($rows.length < that.options.sortPriority.length && typeof that.options.sortPriority === 'object') {
+                    for (var i = 0; i < that.options.sortPriority.length; i++) {
+                        that.addLevel(i, that.options.sortPriority[i]);
+                    }
                 }
                 }
             } else {
             } else {
                 that.addLevel(0);
                 that.addLevel(0);