浏览代码

Fix row events and mergeCell method can not work bug when detailView is true.

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

+ 8 - 0
src/bootstrap-table.js

@@ -1448,6 +1448,9 @@
             if (typeof events === 'string') {
                 events = calculateObjectValue(null, events);
             }
+            if (!that.options.cardView && that.options.detailView) {
+                i += 1;
+            }
             for (var key in events) {
                 that.$body.find('tr').each(function () {
                     var $tr = $(this),
@@ -1973,6 +1976,11 @@
             $tr = this.$body.find('tr'),
             $td = $tr.eq(row).find('td').eq(col);
 
+        if (!this.options.cardView && this.options.detailView) {
+            col += 1;
+        }
+        $td = $tr.eq(row).find('td').eq(col);
+
         if (row < 0 || col < 0 || row >= this.data.length) {
             return;
         }