Skip to content

When on last page of results, the last range number is incorrect when fewer than pagesize elements returned. #34

@rouilj

Description

@rouilj

The range element of the pagination fragment 10..20 can have an incorrect end point (20 in this example)
if the number of elements returned from the rest interface was not the page size (in this case pagesize = 10).
See the screenshot in this comment that shows 1..50 for 5 items.

It looks like modifying getPaginationFragment() to include a pagesize and a new datasize parmeter (where datasize variable
is data.collection.length in the caller). Then calculating the end count using
((parseInt(index) - 1) * parseInt(pagesize)) + datasize
should fix this.

I am assigning this to Nikunj and not Malav so that we have a couple of devs working on classhelper.js.
Be careful you don't accidentally clobber each other's work on a merge.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions