浏览代码

change data('value') to attr('data-value')

> To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method.
http://api.jquery.com/data/#data-key

And works
David 11 年之前
父节点
当前提交
8f9c9a14bd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.js

@@ -355,7 +355,7 @@
                 // save td's id and class
                 row['_' + field + '_id'] = $(this).attr('id');
                 row['_' + field + '_class'] = $(this).attr('class');
-                row['_' + field + '_data_value'] = $(this).data('value');
+                row['_' + field + '_data_value'] = $(this).attr('data-value');
             });
             data.push(row);
         });