When I have table with Pagination and the rows have numbers like this:
1 ---------
2 ---------
3 ---------
So, when I go to the second page by Pagination the rows start from:
1 ---------
but it must start from:
4 ---------
How can I solve this bug?
Metronic
Vue demo 8 version 8.1.6
node v18.14.1
npm 9.6.0
Hi Hosam,
Thank you for reaching out to us.
After checking this issue, it seems like pagination works as expected.
Do you have this issue on our preview page?
If you want to change the default behavior of our pagination component you can change it in src/components/kt-datatable/table-partials/table-content/table-footer/TablePagination.vue
Or alternatively, you can use Element Plus pagination component.
https://element-plus.org/en-US/component/pagination.html
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Pagination works fine , but I want the first column of the table to be the line numbers like index , I did this , but my problem is when I go to the second page of the table by pagination the line counting starts from the beginning , I will explain to you :
page one :
1-
2-
3-
....................
page two :
1-
2-
---------------------------------------------------
So I want the page two start from 4 not from 1 like this :
4-
5-
Hi Hosam,
Do you use static data or it is data from your server?
Usually, data in database have a unique index you can use it for id column.
Regards,
Lauris Stepanovs,
Keenthemes Support Team
I used data from my server
Is there another way I can use it without this ( in database have a unique index you can use it for id column ) .
Hi Hosam,
If you just use your server as a data source and then handle pagination on the client then you can map your data array to add an id before passing it into a component.
let exampels = data.map((obj, id) => ({ ...obj, id: id }))