Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Extended the PaginationRowCountHTML.svelte to show pagesTotal etc #73

Closed
michapixel opened this issue Sep 27, 2022 · 0 comments
Closed

Comments

@michapixel
Copy link

$: pagesTotal = Math.ceil($rowsCount / $options.rowsPerPage);
$: start = $pageNumber * $options.rowsPerPage - $options.rowsPerPage + 1
$: end = Math.min($pageNumber * $options.rowsPerPage, $rowsCount)
$: rows = $rowsCount
$: info = $options.labels.info
		.replace('{rowsPerPage}', `<b>${$options.rowsPerPage}</b>`)
		.replace('{pageNumber}', `<b>${$pageNumber}</b>`)
		.replace('{pagesTotal}', `<b>${pagesTotal}</b>`)
		.replace('{start}', `<b>${start}</b>`)
		.replace('{end}', `<b>${end}</b>`)
		.replace('{rows}', `<b>${rows}</b>`)

so that way we could set this in settings:

labels: {
    [...]
   info: 'Page {pageNumber} of {pagesTotal} ({rowsPerPage} rows per page)',
}
@vincjo vincjo closed this as completed Jun 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants