Skip to content

Commit 07a49c2

Browse files
committed
remove pageIndex restoration
1 parent 8c80a33 commit 07a49c2

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

0 Bytes
Loading

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,29 @@ test('Full size pager', async (t) => {
3939
.eql('Page 6 of 20 (100 items)')
4040
.expect(dataGrid.getDataCell(29, 2).element.textContent)
4141
.eql('29');
42-
// set page sige to 10
42+
43+
// set page size to 10
4344
await t
4445
.click(pager.getPageSize(1).element)
45-
.expect(dataGrid.getDataCell(10 * 6 - 1, 2).element.textContent)
46-
.eql('59');
46+
.expect(dataGrid.getDataCell(9, 2).element.textContent)
47+
.eql('9')
48+
.expect(pager.getInfoText().textContent)
49+
.eql('Page 1 of 10 (100 items)');
50+
4751
// set page index 7
4852
await t
4953
.click(pager.getNavPage('7').element)
5054
.expect(dataGrid.getDataCell(10 * 7 - 1, 2).element.textContent)
5155
.eql('69')
5256
.expect(pager.getInfoText().textContent)
5357
.eql('Page 7 of 10 (100 items)');
58+
5459
// navigate to prev page (6)
5560
await t
5661
.click(pager.getPrevNavButton().element)
5762
.expect(pager.getInfoText().textContent)
5863
.eql('Page 6 of 10 (100 items)');
64+
5965
// navigate to next page (7)
6066
await t
6167
.click(pager.getNextNavButton().element)
@@ -75,12 +81,13 @@ test.meta({ browserSize: [350, 600] })('Compact pager', async (t) => {
7581
const pageIndexWidget = new TextBox(pager.getPageIndexWidget() as any);
7682
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
7783
await t
78-
.typeText(pageIndexWidget.input, '7', { replace: true })
7984
.click(pageSizeWidget.dropDownButton)
8085
.pressKey('down')
8186
.pressKey('enter')
8287
.expect(pageSizeWidget.input.value)
8388
.eql('10')
89+
.typeText(pageIndexWidget.input, '7', { replace: true })
90+
.pressKey('enter')
8491
.expect(dataGrid.getDataCell(10 * 7 - 1, 2).element.textContent)
8592
.eql('69');
8693

@@ -267,6 +274,7 @@ test('Pager info should show page 1 of 1 after changing pageSize to \'all\' with
267274
showPageSizeSelector: true,
268275
showInfo: true,
269276
showNavigationButtons: true,
277+
displayMode: 'full',
270278
},
271279
height: 400,
272280
}));
@@ -300,6 +308,7 @@ test('Pager info should show page 1 of 1 after changing pageSize to \'all\' and
300308
showPageSizeSelector: true,
301309
showInfo: true,
302310
showNavigationButtons: true,
311+
displayMode: 'full',
303312
},
304313
height: 400,
305314
onOptionChanged: (e) => {

packages/devextreme/js/__internal/grids/grid_core/data_controller/m_data_controller.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,26 @@ const changePaging = function (that, optionName, value) {
4242
dataSource[optionName](value);
4343

4444
that._skipProcessingPagingChange = true;
45-
that.option(`paging.${optionName}`, value);
46-
if (optionName === 'pageSize' && value === 0) {
45+
46+
if (optionName === 'pageSize') {
4747
that.option('paging.pageIndex', 0);
4848
}
49+
that.option(`paging.${optionName}`, value);
50+
4951
that._skipProcessingPagingChange = false;
5052
const pageIndex = dataSource.pageIndex();
5153
that._isPaging = optionName === 'pageIndex';
54+
5255
return dataSource[optionName === 'pageIndex' ? 'load' : 'reload']()
5356
.done(() => {
5457
that._isPaging = false;
5558
that.pageChanged.fire(pageIndex);
5659
});
5760
}
61+
5862
return Deferred().resolve().promise();
5963
}
64+
6065
return dataSource[optionName]();
6166
}
6267

0 commit comments

Comments
 (0)