hjalmers / angular-generic-table

A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
https://hjalmers.github.io/angular-generic-table/
MIT License
105 stars 55 forks source link

Table info's records amount is overwritten by filter and search pipes when lazy loading is enabled and totals are present #203

Closed erewego closed 6 years ago

erewego commented 6 years ago

Expected Behavior

Table info (paging, recordsAll, recordsAfterSearch, recordsAfterFilter) should be filled from server response when lazy loading is enabled. Regardless of "Totals" rows presence.

Current Behavior

When gtTotals is defined, gtInfo's propreties recordsAll, recordsAfterSearch, recordsAfterFilter are wrong and equal to pageTotal.

Possible Solution

Don't use filter and search pipes in totals row if lazy loading is enabled in options. Here, for example: https://github.com/hjalmers/angular-generic-table/blob/master/%40angular-generic-table/core/components/generic-table.component.ts#L46

Steps to Reproduce

  1. Enable lazy loading in config.
  2. Add gt-table-info component to page to monitor current table info.
  3. Initialize gtTotals, pass an empty list or actual totals config.
  4. Observe wrong behavior and errors in browser console.