Ngx-datatable: Dynamic client-side pagination does not work if count is not set

Created on 7 Sep 2017  路  10Comments  路  Source: swimlane/ngx-datatable

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Assuming that my Component class has a limit property which holds a number representing the amount of rows that I want to display (as a limit per page). This value can change.

Current behavior
If I set only: [limit]="limit" then the pagination will not work.

If I set: [limit]="limit" and [count]="limit" then the pagination will work as expected (so limit rows per page).

Expected behavior
[count] is supposed to be The total count of all rows. so I don't understand why I need to bind it to limit instead of the total amount of rows.

  • Table version: ^10.2.1

  • Angular version: ^4.3.6"

Most helpful comment

@wizarrc @amcdnl thanks a lot!

All 10 comments

@ShinDarth Do you have external paging turned on? External paging requires count to be set.

@ShinDarth Also, do you have scrollbarV set to true?

@wizarrc I don't have externalPaging set. As I said, this is about client-side paging. Now that you mentioned, I tested also the server side rendering and that is not affected by this bug.

I haven't set scrollbarV so I'm using its default value.

@ShinDarth I can't reproduce it. http://plnkr.co/edit/2X96Y1PJKAJM3lolcy2s?p=preview

Can you show me how it doesn't work?

in my case I assign [limit] to a variable that the user can change instead of a fixed number, just that

I am able to reproduce the problem and updated the link

This is a bug for sure!

limit

@ShinDarth Found the bug in the code, submitted PR, now we wait. 馃榾 Cheers!

Accepted and published :)

@wizarrc @amcdnl thanks a lot!

That was quick!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alceucardoso picture alceucardoso  路  3Comments

mmrath picture mmrath  路  3Comments

eddy-geek picture eddy-geek  路  3Comments

Matthi0uw picture Matthi0uw  路  3Comments

paritosh64ce picture paritosh64ce  路  3Comments