EnhancedLightningGrid icon indicating copy to clipboard operation
EnhancedLightningGrid copied to clipboard

SDG (with Apex sdgIDataProvider) receives the wrong page number when changing filters or page size

Open the-last-byte opened this issue 2 years ago • 0 comments

This issue affects SDGs created using an Apex (sdgIDataProvider) based data provider.

Issue When the user changes a filter or the page size, the page number resets to 1 on the client-side. However, the getData method of the custom data provider still receives a SDGRequest with the old page number (PageID) - making it impossible to know the correct query limits to apply.

Potential Fix Reset the page index in the Aura component after a filter has changed and after the page size has been changed. Make sure the reset page number is sent to the server.

Workaround A workaround involves using the sortablegrid__sdg_Preferences__c to record EVERY query. Add a new field to the object to handle the last page size queried.

If the filters/page size differs from the preferences saved on the last request, assume the page number is 1.

the-last-byte avatar Apr 19 '22 04:04 the-last-byte