Skip to content

Commit 52e9166

Browse files
handle summary rows when expandable is enabled
1 parent 5258759 commit 52e9166

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

client/packages/lowcoder/src/comps/comps/tableComp/tableCompView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ export function TableCompView(props: {
859859
return (
860860
<TableSummary
861861
tableSize={size}
862+
expandableRows={Boolean(expansion.expandModalView)}
862863
summaryRows={parseInt(summaryRows)}
863864
columns={columns}
864865
summaryRowStyle={summaryRowStyle}

client/packages/lowcoder/src/comps/comps/tableComp/tableSummaryComp.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ function TableSummaryCellView(props: {
164164

165165
export function TableSummary(props: {
166166
tableSize: string;
167+
expandableRows: boolean;
167168
summaryRows: number;
168169
columns: ColumnComp[];
169170
summaryRowStyle: TableSummaryRowStyleType;
@@ -173,8 +174,12 @@ export function TableSummary(props: {
173174
summaryRows,
174175
summaryRowStyle,
175176
tableSize,
177+
expandableRows,
176178
} = props;
177-
const visibleColumns = columns.filter(col => !col.getView().hide);
179+
let visibleColumns = columns.filter(col => !col.getView().hide);
180+
if (expandableRows) {
181+
visibleColumns.unshift(new ColumnComp({}));
182+
}
178183

179184
if (!visibleColumns.length) return <></>;
180185

@@ -184,7 +189,6 @@ export function TableSummary(props: {
184189
<TableSummaryRow key={rowIndex}>
185190
{visibleColumns.map((column, index) => {
186191
const summaryColumn = column.children.summaryColumns.getView()[rowIndex].getView();
187-
console.log(summaryColumn.cellTooltip)
188192
return (
189193
<TableSummaryCellView
190194
index={index}

0 commit comments

Comments
 (0)