ソースを参照

Support data attributes: data-formatter.

zhixin 11 年 前
コミット
38ebdd43d2
1 ファイル変更3 行追加1 行削除
  1. 3 1
      src/bootstrap-table.js

+ 3 - 1
src/bootstrap-table.js

@@ -478,6 +478,8 @@
 
                 if (typeof that.header.formatters[j] === 'function') {
                     value = that.header.formatters[j](value, item);
+                } else if (typeof that.header.formatters[j] === 'string') {
+                    value = eval(that.header.formatters[j] + '(value, item)'); // eval ?
                 }
 
                 text = ['<td' + sprintf(' style="%s"', that.header.styles[j]) + '>',
@@ -646,7 +648,7 @@
                 'getSelections',
                 'load', 'append', 'mergeCells',
                 'checkAll', 'uncheckAll',
-                'resetView', 'destroy'
+                'destroy', 'resetView'
             ],
             value;