浏览代码

Fix #1390: radio maintainSelected bug.

zhixin 10 年之前
父节点
当前提交
8062df3fca
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/bootstrap-table.js

+ 6 - 0
src/bootstrap-table.js

@@ -1606,6 +1606,12 @@
                 checked = $this.prop('checked'),
                 row = that.data[$this.data('index')];
 
+            if (that.options.maintainSelected && $(this).is(':radio')) {
+                $.each(that.options.data, function (i, row) {
+                    row[that.header.stateField] = false;
+                });
+            }
+
             row[that.header.stateField] = checked;
 
             if (that.options.singleSelect) {