Skip to content

Commit

Permalink
Fix 'scrollBottom' List loading mode interaction with the Push API (T…
Browse files Browse the repository at this point in the history
…937825) (DevExpress#14854)

* Fix 'scrollBottom' List loading mode interaction with the Push API (T937825)

* Update liveUpdateTests.js

* Update testing/tests/DevExpress.ui.widgets/listParts/liveUpdateTests.js

Co-authored-by: Alexander Ziborov <[email protected]>

* Update testing/tests/DevExpress.ui.widgets/listParts/liveUpdateTests.js

Co-authored-by: Alexander Ziborov <[email protected]>

* Update testing/tests/DevExpress.ui.widgets/listParts/liveUpdateTests.js

Co-authored-by: Alexander Ziborov <[email protected]>

Co-authored-by: Alexander Ziborov <[email protected]>
  • Loading branch information
DokaRus and San4es authored Oct 8, 2020
1 parent ed3a6ca commit 6e0f6b4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/ui/list/ui.list.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export const ListBase = CollectionWidget.inherit({
this.callBase.apply(this, arguments);

this._refreshItemElements();
this._updateLoadingState();
this._updateLoadingState(true);
},

reorderItem: function(itemElement, toItemElement) {
Expand Down
33 changes: 33 additions & 0 deletions testing/tests/DevExpress.ui.widgets/listParts/liveUpdateTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,39 @@ QUnit.module('live update', {
assert.deepEqual(this.itemRenderedSpy.lastCall.args[0].itemData, pushData[1].data, 'check last updated item');
});

QUnit.test('load new page by scrolling after updating an item (T937825)', function(assert) {
const list = this.createList({
pageLoadMode: 'scrollBottom',
height: 40,
displayExpr: 'text',
dataSource: {
paginate: true,
pageSize: 2,
pushAggregationTimeout: 0,
key: 'id',
store: [
{ id: 1, text: 'item1' },
{ id: 2, text: 'item2' },
{ id: 3, text: 'item3' },
{ id: 4, text: 'item4' },
{ id: 5, text: 'item5' }
]
}
});
const store = list.getDataSource().store();

store.push([
{
type: 'update',
data: { text: 'itemN' },
key: 1
}
]);
list.scrollTo(100);

assert.strictEqual(list.itemElements().length, 4, '2nd page is loaded');
});

QUnit.test('push & repaintChangesOnly', function(assert) {
const data = [{ a: 'Item 0', id: 0 }, { a: 'Item 1', id: 1 }];
const list = this.createList({
Expand Down

0 comments on commit 6e0f6b4

Please sign in to comment.