Skip to content

Commit ddbae97

Browse files
authored
DataGrid - Cannot read properties of undefined (reading 'done') error occurs when column fixing and state storing are used (T1283168) (DevExpress#29356)
1 parent 016df42 commit ddbae97

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

e2e/testcafe-devextreme/tests/dataGrid/common/stateStoring/stateStoring.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,29 @@ const makeLocalStorageJsonInvalid = ClientFunction(() => {
1616
window.localStorage.testStorageKey = '{]';
1717
});
1818

19+
const dataGridConfig = {
20+
dataSource: [
21+
{ id: 0, text: 'item 1' },
22+
{ id: 1, text: 'item 2' },
23+
{ id: 2, text: 'item 3' },
24+
{ id: 3, text: 'item 4' },
25+
],
26+
columnFixing: {
27+
enabled: true,
28+
},
29+
keyExpr: 'id',
30+
stateStoring: {
31+
enabled: true,
32+
},
33+
scrolling: {
34+
mode: 'virtual' as any,
35+
},
36+
customizeColumns(columns) {
37+
columns[0].fixed = true;
38+
columns[0].fixedPosition = 'sticky';
39+
},
40+
};
41+
1942
test('The Grid should load if JSON in localStorage is invalid and stateStoring enabled', async (t) => {
2043
const dataGrid = new DataGrid(GRID_CONTAINER);
2144
const secondCell = dataGrid.getDataCell(1, 1);
@@ -110,3 +133,12 @@ test('The focused state of a row with the 0 key should be restored (T1252962)',
110133
},
111134
},
112135
}));
136+
137+
test('DataGrid - Cannot read properties of undefined (reading \'done\') error occurs when column fixing and state storing are used (T1283168)', async (t) => {
138+
await t.eval(() => location.reload());
139+
await createWidget('dxDataGrid', { ...dataGridConfig });
140+
// eslint-disable-next-line max-len
141+
// DataGrid is expected to load normally with the given configuration, so no other checks are required.
142+
}).before(async () => {
143+
await createWidget('dxDataGrid', { ...dataGridConfig });
144+
});

packages/devextreme/js/__internal/grids/grid_core/column_headers/m_column_headers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import messageLocalization from '@js/common/core/localization/message';
33
import domAdapter from '@js/core/dom_adapter';
44
import type { dxElementWrapper } from '@js/core/renderer';
55
import $ from '@js/core/renderer';
6+
import { Deferred } from '@js/core/utils/deferred';
67
import { extend } from '@js/core/utils/extend';
78
import { each } from '@js/core/utils/iterator';
89
import { getHeight } from '@js/core/utils/size';
@@ -294,7 +295,8 @@ export class ColumnHeadersView extends ColumnsView {
294295
const change = {};
295296

296297
if (that._tableElement && !that._dataController.isLoaded() && !that._hasRowElements) {
297-
return;
298+
// @ts-expect-error
299+
return new Deferred().resolve();
298300
}
299301

300302
$container

0 commit comments

Comments
 (0)