浏览代码

use the existing for each to set the column indexes

Dustin Utecht 6 年之前
父节点
当前提交
96814950bf
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      src/extensions/reorder-columns/bootstrap-table-reorder-columns.js

+ 1 - 4
src/extensions/reorder-columns/bootstrap-table-reorder-columns.js

@@ -138,15 +138,12 @@ BootstrapTable.prototype.makeRowsReorderable = function () {
       for (let i = 0; i < ths.length; i++ ) {
         columnIndex = that.fieldsColumnsIndex[ths[i]]
         if (columnIndex !== -1) {
+          that.fieldsColumnsIndex[ths[i]] = i
           that.columns[columnIndex].fieldIndex = i
           columns.push(that.columns[columnIndex])
         }
       }
 
-      for (let i = 0; i < ths.length; i++ ) {
-        that.fieldsColumnsIndex[ths[i]] = i
-      }
-
       that.columns = columns
 
       filterFn() // Support <IE9