浏览代码

Merge pull request #1336 from Cowdrey/patch-1

Fixed bug 1318
文翼 10 年之前
父节点
当前提交
6eea493efe
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/extensions/reorder-columns/bootstrap-table-reorder-columns.js

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

@@ -95,11 +95,13 @@
             clickDelay:200,
             clickDelay:200,
             beforeStop: function() {
             beforeStop: function() {
                 var ths = [],
                 var ths = [],
+                    formatters = [],
                     columns = [],
                     columns = [],
                     columnsHidden = [],
                     columnsHidden = [],
                     columnIndex = -1;
                     columnIndex = -1;
                 that.$header.find('th').each(function (i) {
                 that.$header.find('th').each(function (i) {
                     ths.push($(this).data('field'));
                     ths.push($(this).data('field'));
+                    formatters.push($(this).data('formatter'));
                 });
                 });
 
 
                 //Exist columns not shown
                 //Exist columns not shown
@@ -109,6 +111,7 @@
                     });
                     });
                     for (var i = 0; i < columnsHidden.length; i++) {
                     for (var i = 0; i < columnsHidden.length; i++) {
                         ths.push(columnsHidden[i].field);
                         ths.push(columnsHidden[i].field);
+                        formatters.push(columnsHidden[i].formatter);
                     }
                     }
                 }
                 }
 
 
@@ -122,9 +125,10 @@
 
 
                 that.columns = that.columns.concat(columns);
                 that.columns = that.columns.concat(columns);
                 that.header.fields = ths;
                 that.header.fields = ths;
+                that.header.formatters = formatters;
                 that.resetView();
                 that.resetView();
                 that.trigger('reorder-column', ths);
                 that.trigger('reorder-column', ths);
             }
             }
         });
         });
     };
     };
-}(jQuery);
+}(jQuery);