Browse Source

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

zhixin 10 years ago
parent
commit
b1b083fe58
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/bootstrap-table.js

+ 8 - 0
src/bootstrap-table.js

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