Browse Source

Fix #3472: add group header not the first th border left bug

zhixin 8 years ago
parent
commit
2abf4bc61b
2 changed files with 6 additions and 1 deletions
  1. 1 1
      src/bootstrap-table.css
  2. 5 0
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.css

@@ -72,7 +72,7 @@
     outline: 0 solid transparent;
 }
 
-.fixed-table-container thead th:first-child {
+.fixed-table-container thead th:first-child:not([data-not-first-th]) {
     border-left: none;
     border-top-left-radius: 4px;
     -webkit-border-top-left-radius: 4px;

+ 5 - 0
src/bootstrap-table.js

@@ -843,6 +843,7 @@
                     sprintf(' rowspan="%s"', column.rowspan),
                     sprintf(' colspan="%s"', column.colspan),
                     sprintf(' data-field="%s"', column.field),
+                    j === 0 && column.fieldIndex ? ' data-not-first-th' : '',
                     '>');
 
                 html.push(sprintf('<div class="th-inner %s">', that.options.sortable && column.sortable ?
@@ -2244,6 +2245,10 @@
                 index = i - 1;
             }
 
+            if (index === -1) {
+                return;
+            }
+
             var $th = that.$header_.find(sprintf('th[data-field="%s"]', visibleFields[index]));
             if ($th.length > 1) {
                 $th = $($ths[$this[0].cellIndex]);