ソースを参照

Fix not match colspan bug.

zhixin 10 年 前
コミット
a1e8a5e91e
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/bootstrap-table.js

+ 2 - 2
src/bootstrap-table.js

@@ -1370,7 +1370,8 @@
         // show no records
         // show no records
         if (!html.length) {
         if (!html.length) {
             html.push('<tr class="no-records-found">',
             html.push('<tr class="no-records-found">',
-                sprintf('<td colspan="%s">%s</td>', this.header.fields.length, this.options.formatNoMatches()),
+                sprintf('<td colspan="%s">%s</td>',
+                    this.$header.find('th').length, this.options.formatNoMatches()),
                 '</tr>');
                 '</tr>');
         }
         }
 
 
@@ -1378,7 +1379,6 @@
         this.$body.html(html.join(''));
         this.$body.html(html.join(''));
         this.trigger('post-rows');
         this.trigger('post-rows');
 
 
-
         if (!fixedScroll) {
         if (!fixedScroll) {
             this.scrollTo(0);
             this.scrollTo(0);
         }
         }