From 19a4036021bda0dedeab0928ff2f7a797bc23ac1 Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Thu, 24 Sep 2020 11:07:56 +0300 Subject: [PATCH] Fixed row grouping --- src/components/datatable/TableBody.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/datatable/TableBody.vue b/src/components/datatable/TableBody.vue index c9add398d..cee92d508 100755 --- a/src/components/datatable/TableBody.vue +++ b/src/components/datatable/TableBody.vue @@ -208,14 +208,14 @@ export default { shouldRenderBodyCell(value, column, i) { if (this.rowGroupMode) { if (this.rowGroupMode === 'subheader') { - return this.groupRowsBy !== column.field; + return this.groupRowsBy !== column.props.field; } else if (this.rowGroupMode === 'rowspan') { if (this.isGrouped(column)) { let prevRowData = value[i - 1]; if (prevRowData) { - let currentRowFieldData = ObjectUtils.resolveFieldData(value[i], column.field); - let previousRowFieldData = ObjectUtils.resolveFieldData(prevRowData, column.field); + let currentRowFieldData = ObjectUtils.resolveFieldData(value[i], column.props.field); + let previousRowFieldData = ObjectUtils.resolveFieldData(prevRowData, column.props.field); return currentRowFieldData !== previousRowFieldData; } else { @@ -233,7 +233,7 @@ export default { }, calculateRowGroupSize(value, column, index) { 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 groupRowSpan = 0; @@ -241,7 +241,7 @@ export default { groupRowSpan++; let nextRowData = value[++index]; if (nextRowData) { - nextRowFieldData = ObjectUtils.resolveFieldData(nextRowData, column.field); + nextRowFieldData = ObjectUtils.resolveFieldData(nextRowData, column.props.field); } else { break; @@ -265,9 +265,9 @@ export default { isGrouped(column) { if (this.groupRowsBy) { if (Array.isArray(this.groupRowsBy)) - return this.groupRowsBy.indexOf(column.field) > -1; + return this.groupRowsBy.indexOf(column.props.field) > -1; else - return this.groupRowsBy === column.field; + return this.groupRowsBy === column.props.field; } else { return false;