浏览代码

fix(js): move formatter after cellStyle

fixes #2034
zhixin 9 年之前
父节点
当前提交
a54f6800c0
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/bootstrap-table.js

+ 3 - 3
src/bootstrap-table.js

@@ -1611,9 +1611,6 @@
 
                 style = sprintf('style="%s"', csses.concat(that.header.styles[j]).join('; '));
 
-                value = calculateObjectValue(column,
-                    that.header.formatters[j], [value, item, i], value);
-
                 // handle td's id and class
                 if (item['_' + field + '_id']) {
                     id_ = sprintf(' id="%s"', item['_' + field + '_id']);
@@ -1643,6 +1640,9 @@
                     style = sprintf('style="%s"', csses_.concat(that.header.styles[j]).join('; '));
                 }
 
+                value = calculateObjectValue(column,
+                    that.header.formatters[j], [value, item, i], value);
+
                 if (item['_' + field + '_data'] && !$.isEmptyObject(item['_' + field + '_data'])) {
                     $.each(item['_' + field + '_data'], function (k, v) {
                         // ignore data-index