enterprise icon indicating copy to clipboard operation
enterprise copied to clipboard

Datagrid: Loading data with the loadData/updateDataset API does not honor the passed in activePage number and does not render the right rows

Open aaronpikkarainen opened this issue 9 months ago • 0 comments

Describe the bug I found some problems with the DataGrid's loadData/updateDataset API involving paging, and I have a coding solution to fix them. That API call accepts a pagerInfo param with an "activePage" value. If no activePage is passed in, then page 1 is assumed (which is good). However, after going to page 2, then calling the loadData API, the pager will show the requested page number properly, but the grid will render the wrong page of rows.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://latest-enterprise.demo.design.infor.com/components/datagrid/test-large-dataset-performance.html
  2. Click on Load Data to get data in the grid
  3. Click Next Page to get to page 2
  4. Notice the grid renders the page 2 rows properly
  5. Now click on Load Data again
  6. Notice the pager shows "Page 1" (which is good), but the rendered rows are from page 2 (A similar problem happens when passing in an "activePage" value)

Expected behavior When using the loadData/updateDataset API, the grid should render the correct page of rows. If no activePage is passed in, then the grid should render page 1's rows. If an activePage is passed in, then the grid should render that page's rows.

Version

  • ids-enterprise: v4.94.2

Screenshots image

Platform

  • Infor Application/Team Name: CSD
  • Device: Dell laptop
  • OS Version: Windows 11
  • Browser Name: Chrome
  • Browser Version: 124.0.6367.119 (Official Build) (64-bit)

Coding Solution In datagrid.js find the loadData function and change line 1169 to be this (it fixes both issues):

if (this.pagerAPI) { this.pagerAPI.activePage = pagerInfo.activePage || 1;

aaronpikkarainen avatar May 03 '24 17:05 aaronpikkarainen