Unplanned
Last Updated: 29 Jan 2020 10:55 by Mohammed
Mohammed
Created on: 28 Jan 2020 17:25
Category: Grid
Type: Bug Report
13
Endless scroll - Page Does Not Reset Correctly Upon Querying

Bug Report

When endless scrolling is implemented, manual DataSource operations using the DataSource APIs(query, page, sort, etc.) do not work as expected.  The endless scrolling settings are causing paging issues.  

Reproduction of the problem

  1. Visit this Kendo UI Dojo.
  2. Scroll to 40.
  3. Click the Reset Filter button.

Current Behavior

The first page is only accessible, and when scrolling down the reads continue to occur.

Expected/desired behavior

The endless scrolling settings should not interfere with manual dataSource operations.

Workarounds

  1. Solution when read is called, the Kendo UI Grid will reset to its original state(dojo). 
        kendo.ui.Pager.fn._refreshClick = function (e) {
            e.preventDefault();
            var grid = $("#grid").getKendoGrid();
            grid.dataSource.options.endless = null;
          	grid._endlessPageSize = 20;
          	grid.dataSource.pageSize(20);
        }
  2. Solution which overrides the data(dojo).
        kendo.ui.Pager.fn._refreshClick = function (e) {
            e.preventDefault();
            var grid = $("#grid").getKendoGrid();
            window.restoreScroll = true;
            window.scolledValue = grid.content[0].scrollTop;
            grid.dataSource._data.empty();
            grid.dataSource._pristineData = [];
            grid.dataSource.read();
        }

Environment

  • Kendo UI version: 2020.1.114
1 comment
Mohammed
Posted on: 29 Jan 2020 10:55

This bug also interferes with Pager component in Endless scroll.

  1. Let's say we have 2000 items with 100 items per page
  2. Start searching in code from 300th item (pager shows 301-400 from 2000 items)
  3. Start scrolling to 400th item
  4. Pager shows 1-200 from 2000 items
  5. The 100th item in the Grid is the 1st item from data (since items in endless scroll are appended)