Fixed row grouping

pull/496/head
Cagatay Civici 2020-09-24 11:07:56 +03:00
parent effb19203a
commit 19a4036021
1 changed files with 7 additions and 7 deletions

View File

@ -208,14 +208,14 @@ export default {
shouldRenderBodyCell(value, column, i) { shouldRenderBodyCell(value, column, i) {
if (this.rowGroupMode) { if (this.rowGroupMode) {
if (this.rowGroupMode === 'subheader') { if (this.rowGroupMode === 'subheader') {
return this.groupRowsBy !== column.field; return this.groupRowsBy !== column.props.field;
} }
else if (this.rowGroupMode === 'rowspan') { else if (this.rowGroupMode === 'rowspan') {
if (this.isGrouped(column)) { if (this.isGrouped(column)) {
let prevRowData = value[i - 1]; let prevRowData = value[i - 1];
if (prevRowData) { if (prevRowData) {
let currentRowFieldData = ObjectUtils.resolveFieldData(value[i], column.field); let currentRowFieldData = ObjectUtils.resolveFieldData(value[i], column.props.field);
let previousRowFieldData = ObjectUtils.resolveFieldData(prevRowData, column.field); let previousRowFieldData = ObjectUtils.resolveFieldData(prevRowData, column.props.field);
return currentRowFieldData !== previousRowFieldData; return currentRowFieldData !== previousRowFieldData;
} }
else { else {
@ -233,7 +233,7 @@ export default {
}, },
calculateRowGroupSize(value, column, index) { calculateRowGroupSize(value, column, index) {
if (this.isGrouped(column)) { if (this.isGrouped(column)) {
let currentRowFieldData = ObjectUtils.resolveFieldData(value[index], column.field); let currentRowFieldData = ObjectUtils.resolveFieldData(value[index], column.props.field);
let nextRowFieldData = currentRowFieldData; let nextRowFieldData = currentRowFieldData;
let groupRowSpan = 0; let groupRowSpan = 0;
@ -241,7 +241,7 @@ export default {
groupRowSpan++; groupRowSpan++;
let nextRowData = value[++index]; let nextRowData = value[++index];
if (nextRowData) { if (nextRowData) {
nextRowFieldData = ObjectUtils.resolveFieldData(nextRowData, column.field); nextRowFieldData = ObjectUtils.resolveFieldData(nextRowData, column.props.field);
} }
else { else {
break; break;
@ -265,9 +265,9 @@ export default {
isGrouped(column) { isGrouped(column) {
if (this.groupRowsBy) { if (this.groupRowsBy) {
if (Array.isArray(this.groupRowsBy)) if (Array.isArray(this.groupRowsBy))
return this.groupRowsBy.indexOf(column.field) > -1; return this.groupRowsBy.indexOf(column.props.field) > -1;
else else
return this.groupRowsBy === column.field; return this.groupRowsBy === column.props.field;
} }
else { else {
return false; return false;