浏览代码

fix #2458: Fixed table resize after mergeCell the first row

zhixin 6 年之前
父节点
当前提交
03f5496290
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/bootstrap-table.js

+ 6 - 1
src/bootstrap-table.js

@@ -2233,8 +2233,13 @@
 
       const visibleFields = this.getVisibleFields()
       const $ths = this.$header_.find('th')
+      let $tr = this.$body.find('>tr:first-child:not(.no-records-found)')
 
-      this.$body.find('>tr:first-child:not(.no-records-found) > *').each((i, el) => {
+      while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
+        $tr = $tr.next()
+      }
+
+      $tr.find('> *').each((i, el) => {
         const $this = $(el)
         let index = i