eclipse-esmf / esmf-sdk-js-schematics

Create UI components for Angular applications with Schematics based on Aspect Models.
https://eclipse-esmf.github.io/js-sdk-guide/index.html
Mozilla Public License 2.0
2 stars 2 forks source link

[BUG] Table paginator works incorrectly in remote data loading mode #77

Closed sha4be closed 5 months ago

sha4be commented 5 months ago

How: List of performed steps

  1. Generate a table with a remote data loading option
  2. Open the table and change the page size

What: Actual result vs expected result Expected result - page size is changed, whereas total number of items stays with no changes Actual result - page size is changed, and the total number of pages is equal to the page size

Where: (e.g. component, version, url, your system info) The issue's root cause is in table.component requestData method. The following line this.paginator.length = dataToShow.length in incorrect because dataToShow.length - is the total rows at the loaded page, whereas this.paginator.length is the total items available to load. I suggest removing the line to fix the issue. The total number of available rows is set correctly at the table component template [length]="totalItems"

Input (files/screenshots)

Screenshot 2024-04-18 at 15 55 28
michelu89 commented 5 months ago

Removed "this.paginator.length = dataToShow.length;" in the code generation. See: https://github.com/eclipse-esmf/esmf-sdk-js-schematics/pull/79