浏览代码

Fix show columns display bug.

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

+ 4 - 5
src/bootstrap-table.js

@@ -172,9 +172,10 @@
             this.$header.append('<tr></tr>');
             this.$header.append('<tr></tr>');
         }
         }
         this.$header.find('th').each(function() {
         this.$header.find('th').each(function() {
-            var column = $.extend({}, {
-                title: $(this).text()
-            }, $(this).data());
+            var column = $.extend({},
+                BootstrapTable.COLUMN_DEFAULTS, {
+                    title: $(this).text()
+                }, $(this).data());
 
 
             columns.push(column);
             columns.push(column);
         });
         });
@@ -187,8 +188,6 @@
             sorters: []
             sorters: []
         };
         };
         $.each(this.options.columns, function(i, column) {
         $.each(this.options.columns, function(i, column) {
-            column = $.extend({}, BootstrapTable.COLUMN_DEFAULTS, column);
-
             var text = '',
             var text = '',
                 style = sprintf('text-align: %s; ', column.align) +
                 style = sprintf('text-align: %s; ', column.align) +
                         sprintf('vertical-align: %s; ', column.valign),
                         sprintf('vertical-align: %s; ', column.valign),