Search.../

totalPages

Sets or gets the total number of pages shown in a pagination bar.

Description

Setting the totalPages property updates the number of pages shown in the pagination bar.

Setting totalPages to a value less than currentPage causes currentPage to be reset to the new totalPages value. For example, if currentPage is 8 and totalPages is set to 5, currentPage is reset automatically to 5.

If the pagination bar is connected to a dataset, it is recommended that you allow the dateset to control the pagination bar's totalPages value.

Getting the totalPages property returns the total number of pages available for selection in the pagination bar. If the pagination bar is connected to a dataset, the initial totalPages value is calculated based on the total number of items in the dataset and the dataset's page size.

Type:

numberRead & Write

Related Content:

Was this helpful?

Get the number of pages available in a pagination element

Copy Code
1let totalPages = $w("#myPagination").totalPages; // 14
Set the number of pages available in a pagination element

Copy Code
1$w("#myPagination").totalPages = 14;