fix(DataTable): #7335
When `groupRowsBy` is set to `rowspan` and row expansion is enabled, the last rows in a group would shift left. This was caused by the hidden columns defined in `groupRowsBy`. The issue became more noticeable as more rows were expanded. This fix ensures consistent table layout regardless of row expansion.pull/7352/head
parent
e53d48ed62
commit
c5a2863ce2
|
@ -350,12 +350,20 @@ export default {
|
|||
let nextRowFieldData = currentRowFieldData;
|
||||
let groupRowSpan = 0;
|
||||
|
||||
if(this.d_rowExpanded) groupRowSpan++;
|
||||
|
||||
while (currentRowFieldData === nextRowFieldData) {
|
||||
groupRowSpan++;
|
||||
let nextRowData = this.value[++index];
|
||||
|
||||
if (nextRowData) {
|
||||
nextRowFieldData = resolveFieldData(nextRowData, field);
|
||||
|
||||
if(currentRowFieldData === nextRowFieldData){
|
||||
const nextRowKeyData = resolveFieldData(nextRowData, this.dataKey);
|
||||
const isNextRowExpanded = resolveFieldData(this.expandedRows, nextRowKeyData) || this.expandedRows?.some?.((d) => this.equals(nextRowData, d))
|
||||
if(isNextRowExpanded) groupRowSpan++;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue