You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
The issue still exists against the latest master branch of yii2-grid.
This is not an usage question. I confirm having gone through and read the documentation and demos.
This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
I have attempted to find the simplest possible steps to reproduce the issue.
I have included a failing test as a pull request (Optional).
Steps to reproduce the issue
Create a gridview displaying multiple rows containing an ExpandRowColumn.
Create the detail of these rows containing a separate gridview using group=true.
Expand one row, displaying the grid with grouped data.
Expand another row after the expanded row.
Expected behavior and actual behavior
When I follow those steps, I see... The data in the previously displayed detail grid is shifted around incorrectly. Exactly how depends on the specific grouping being done.
I was expecting... No change in the detail grid in the previously expanded row.
The problem seems to be that the rowspan on all previous displayed grouped table cells is incremented. I have tracked it down to enh #689 to fix issue #609 in version 3.1.6, which increments the rowspan to correct a slightly different expandrow with grouping issue. Removing that code or altering it to not use "prevAll()" to include all previous rows eliminates this problem, but I do not know how it may affect other usages of expandrow with grouping. The inclusion of all previous sibling rows is not precisely the problem, either. It is the "find('td[rowspan]')" which finds the grouped rows in all detail grids expanded from those rows that is causing this specific issue.
This is the code in kv-grid-expand.js (currently starting at lines 254 and 289) :
// needed when used together with grouping
var $rowsBefore = $row.prevAll(), expandRowPosition = $row.index() + 1;
$rowsBefore.push($row);
$.each($rowsBefore, function (i, tr) {
var $rowSpanTds = $(tr).find('td[rowspan]');
$.each($rowSpanTds, function (j, td) {
var rowSpan = parseInt($(td).attr('rowspan'));
if ($(tr).index() + rowSpan > expandRowPosition) {
$(td).attr('rowspan', rowSpan + 1);
}
});
});
...
// needed when used together with grouping
var $rowsBefore = $row.prevAll();
$rowsBefore.push($row);
var expandRowPosition = $row.index() + 1;
$.each($rowsBefore, function (i, tr) {
var $rowSpanTds = $(tr).find('td[rowspan]');
$.each($rowSpanTds, function (j, td) {
var rowSpan = parseInt($(td).attr('rowspan'));
if ($(tr).index() + rowSpan > expandRowPosition) {
$(td).attr('rowspan', rowSpan - 1);
}
});
});
Original expanded display:
Expanded display after expanding following row:
Notice that each grouped cell becomes one row taller, which shifts the other cells around incorreclty. The HTML is altered by incrementing the "rowspan" value.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Prerequisites
master
branch of yii2-grid.Steps to reproduce the issue
Expected behavior and actual behavior
When I follow those steps, I see... The data in the previously displayed detail grid is shifted around incorrectly. Exactly how depends on the specific grouping being done.
I was expecting... No change in the detail grid in the previously expanded row.
The problem seems to be that the rowspan on all previous displayed grouped table cells is incremented. I have tracked it down to enh #689 to fix issue #609 in version 3.1.6, which increments the rowspan to correct a slightly different expandrow with grouping issue. Removing that code or altering it to not use "prevAll()" to include all previous rows eliminates this problem, but I do not know how it may affect other usages of expandrow with grouping. The inclusion of all previous sibling rows is not precisely the problem, either. It is the "find('td[rowspan]')" which finds the grouped rows in all detail grids expanded from those rows that is causing this specific issue.
This is the code in kv-grid-expand.js (currently starting at lines 254 and 289) :
Original expanded display:
Expanded display after expanding following row:
Notice that each grouped cell becomes one row taller, which shifts the other cells around incorreclty. The HTML is altered by incrementing the "rowspan" value.
Environment
Browsers
Operating System
Libraries
Isolating the problem
The text was updated successfully, but these errors were encountered: