Browse Source

Fix #3487, #3486: return when fieldIndex is -1

zhixin 8 years ago
parent
commit
78f1c3278d
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/bootstrap-table.js

+ 4 - 0
src/bootstrap-table.js

@@ -1983,6 +1983,10 @@
             var field = that.header.fields[i],
             var field = that.header.fields[i],
                 fieldIndex = $.inArray(field, that.getVisibleFields());
                 fieldIndex = $.inArray(field, that.getVisibleFields());
 
 
+            if (fieldIndex === -1) {
+                return;
+            }
+
             if (that.options.detailView && !that.options.cardView) {
             if (that.options.detailView && !that.options.cardView) {
                 fieldIndex += 1;
                 fieldIndex += 1;
             }
             }