Skip to content

Commit

Permalink
Fix #870: Correct grid grouping rowspan for grouped rows
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Jan 2, 2019
1 parent 3735c99 commit 36b39d2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log: `yii2-grid`
=======================

## Version 3.3.0

**Date:** _under development_

- (enh #870): Correct grid grouping rowspan for grouped rows.

## Version 3.2.9

**Date:** 07-Dec-2018
Expand Down
11 changes: 9 additions & 2 deletions src/assets/js/kv-grid-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ var kvGridGroup;
return source;
};
addRowSpan = function ($el, n) {
if ($el[0].hasAttribute('data-grouped-row')) {
return;
}
n = n || 1;
var rowspan = $el.attr('rowspan') || 1;
rowspan = parseInt(rowspan) + n;
Expand Down Expand Up @@ -230,7 +233,9 @@ var kvGridGroup;
proceed = false;
}
});
$td.attr('rowspan', rowspan);
if (!$td[0].hasAttribute('data-grouped-row')) {
$td.attr('rowspan', rowspan);
}
});
});
$tbody.find(' > tr.kv-group-footer').each(function () {
Expand Down Expand Up @@ -396,7 +401,9 @@ var kvGridGroup;
cellKeyCurr = i > 0 ? getCellKey($cell) : $cell.text().trim();
if (cellKeyCurr === cellKeyPrev) {
rowspan++;
$gCell.attr('rowspan', rowspan);
if (!$gCell[0].hasAttribute('data-grouped-row')) {
$gCell.attr('rowspan', rowspan);
}
$cell.addClass('kv-temp-cells').hide();
} else {
gCol = j;
Expand Down
2 changes: 1 addition & 1 deletion src/assets/js/kv-grid-group.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 36b39d2

Please sign in to comment.