浏览代码

Merge pull request #2023 from dabros/patch-9

fix #2014 - ints break getFieldIndex
wenzhixin 9 年之前
父节点
当前提交
4924549d57
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/bootstrap-table.js

+ 4 - 0
src/bootstrap-table.js

@@ -610,6 +610,10 @@
             var column = [];
 
             $(this).find('th').each(function () {
+                // Fix #2014 - getFieldIndex and elsewhere assume this is string, causes issues if not
+                if (typeof $(this).data('field') !== 'undefined') {
+                    $(this).data('field', new String($(this).data('field')).valueOf()); 
+                }
                 column.push($.extend({}, {
                     title: $(this).html(),
                     'class': $(this).attr('class'),