Skip to content

Commit e8ce638

Browse files
authored
DataGrid - Group summaries are shown over sticky columns on a horizontal scroll (DevExpress#30610)
1 parent 27c0661 commit e8ce638

File tree

12 files changed

+130
-0
lines changed

12 files changed

+130
-0
lines changed
64 KB
Loading
75.1 KB
Loading
63.3 KB
Loading
74.1 KB
Loading

e2e/testcafe-devextreme/tests/dataGrid/sticky/common/withGrouping.ts

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,80 @@ test('DataGrid - Group row content is scrolled if repaintChangesOnly is enabled
281281
autoExpandAll: false,
282282
},
283283
}));
284+
285+
[false, true].forEach((rtlEnabled) => {
286+
// T1284612
287+
safeSizeTest(`DataGrid - Group summaries are shown over sticky columns on a horizontal scroll (rtl=${rtlEnabled})`, async (t) => {
288+
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
289+
290+
const dataGrid = new DataGrid(DATA_GRID_SELECTOR);
291+
292+
await t.expect(dataGrid.isReady()).ok();
293+
294+
await dataGrid.scrollTo(t, { x: rtlEnabled ? 100 : 250 });
295+
await takeScreenshot(`grouping-scroll-total_summary_intersection-rtl=${rtlEnabled}.png`, dataGrid.element);
296+
297+
await dataGrid.apiOption('summary.totalItems', [{
298+
column: 'SaleAmount',
299+
summaryType: 'max',
300+
valueFormat: 'currency',
301+
}]);
302+
await dataGrid.scrollTo(t, { x: 0 });
303+
await dataGrid.scrollTo(t, { x: rtlEnabled ? 100 : 250 });
304+
305+
await takeScreenshot(`grouping-scroll-total_summary-rtl=${rtlEnabled}.png`, dataGrid.element);
306+
307+
await t
308+
.expect(compareResults.isValid())
309+
.ok(compareResults.errorMessages());
310+
}, [900, 800]).before(async () => createWidget('dxDataGrid', {
311+
...defaultConfig,
312+
rtlEnabled,
313+
customizeColumns(columns) {
314+
columns[2].groupIndex = 0;
315+
},
316+
summary: {
317+
groupItems: [{
318+
column: 'OrderNumber',
319+
summaryType: 'count',
320+
displayFormat: '{0} orders',
321+
}, {
322+
column: 'City',
323+
summaryType: 'max',
324+
valueFormat: 'currency',
325+
showInGroupFooter: false,
326+
alignByColumn: true,
327+
}, {
328+
column: 'TotalAmount',
329+
summaryType: 'max',
330+
valueFormat: 'currency',
331+
showInGroupFooter: false,
332+
alignByColumn: true,
333+
}, {
334+
column: 'TotalAmount',
335+
summaryType: 'sum',
336+
valueFormat: 'currency',
337+
displayFormat: 'Total: {0}',
338+
showInGroupFooter: true,
339+
}],
340+
totalItems: [{
341+
column: 'OrderNumber',
342+
summaryType: 'count',
343+
displayFormat: '{0} orders',
344+
}, {
345+
column: 'SaleAmount',
346+
summaryType: 'max',
347+
valueFormat: 'currency',
348+
}, {
349+
column: 'TotalAmount',
350+
summaryType: 'max',
351+
valueFormat: 'currency',
352+
}, {
353+
column: 'TotalAmount',
354+
summaryType: 'sum',
355+
valueFormat: 'currency',
356+
displayFormat: 'Total: {0}',
357+
}],
358+
},
359+
}));
360+
});

packages/devextreme-scss/scss/widgets/base/_gridBase.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@
203203
z-index: 3;
204204
}
205205
}
206+
207+
.dx-#{$widget-name}-total-footer {
208+
.dx-#{$widget-name}-sticky-column, .dx-#{$widget-name}-sticky-column-left, .dx-#{$widget-name}-sticky-column-right {
209+
background-color: transparent;
210+
}
211+
}
206212
}
207213

208214
.dx-sortable-dragging .dx-#{$widget-name}-rowsview .dx-data-row .dx-command-drag {

packages/devextreme-scss/scss/widgets/base/dataGrid/_index.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ $datagrid-text-stub-background-image-path: null !default;
1515
@use "../mixins" as *;
1616
@use "../icons" as *;
1717
@use "./common";
18+
@use "./variables" as *;
1819

1920
.dx-datagrid-borders {
2021
> .dx-datagrid-headers,
@@ -205,6 +206,27 @@ $datagrid-text-stub-background-image-path: null !default;
205206
}
206207
}
207208

209+
.dx-datagrid-total-footer {
210+
.dx-row.dx-footer-row {
211+
td.dx-command-expand {
212+
&.dx-datagrid-sticky-column, &.dx-datagrid-sticky-column-left, &.dx-datagrid-sticky-column-right {
213+
background-color: $datagrid-base-background-color;
214+
}
215+
}
216+
217+
.dx-datagrid-sticky-column,
218+
.dx-datagrid-sticky-column-left,
219+
.dx-datagrid-sticky-column-right {
220+
padding-inline: 0;
221+
222+
.dx-datagrid-summary-item {
223+
background-color: $datagrid-base-background-color;
224+
padding-inline: $datagrid-cell-padding;
225+
}
226+
}
227+
}
228+
}
229+
208230
.dx-datagrid-filter-row .dx-filter-range-content {
209231
color: $datagrid-base-color;
210232
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$datagrid-cell-padding: null !default;

packages/devextreme-scss/scss/widgets/fluent/dataGrid/_sizes.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use "../sizes" as *;
2+
@use '../../base/dataGrid/variables' as *;
23

34
// adduse
45

@@ -17,3 +18,5 @@ $area-field-top-bottom-padding: null !default;
1718
$area-field-border-radius: 4px !default;
1819
$area-field-top-bottom-padding: 2px !default;
1920
}
21+
22+
$datagrid-cell-padding: $fluent-datagrid-cell-padding !default;

packages/devextreme-scss/scss/widgets/generic/dataGrid/_sizes.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use "../sizes" as *;
2+
@use '../../base/dataGrid/variables' as *;
23

34
// adduse
45

@@ -12,3 +13,4 @@ $generic-datagrid-cell-padding: null !default;
1213
$generic-datagrid-cell-padding: 5px !default;
1314
}
1415

16+
$datagrid-cell-padding: $generic-datagrid-cell-padding !default;

0 commit comments

Comments
 (0)