jspreadsheet / ce

Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.
https://bossanova.uk/jspreadsheet/v4
MIT License
6.66k stars 820 forks source link

Get total page number and programmatically change to the last page. #1609

Closed syafiq-dev closed 1 year ago

syafiq-dev commented 1 year ago

Hi,

Is there any way to change to the last page of a table by code. Such as.

var totalPage = myTable.getTotalPage()

// go to last page
myTable.page(totalPage)

I'm using the CE version by the way. Thank you!

hodeware commented 1 year ago

You need to calculate, so it would be something like that. myTable.page(Matil.ceil(myTable.rows.length/myTable.options.pagination));