Spry

Paged View data set options

You can refine the behavior of the Paged View data set by using the following options in the constructor.

Option

Description

Default value

pageSize

The maximum number of items displayed on a page.

10

forceFullPages

If more than one page of data is present, this option forces the last page of data to contain a full set of data. This can cause some items to appear on both the last and next-to-last pages.

false

useZeroBasedIndexes

If true, the caller passes page indexes to the various paging functions that are between zero (0) and n-1, where n is the total number of pages. The default is false, so page numbers are between 1 and n. This is a departure from the Spry zero-based counting system.

false

If no option is specified in the constructor, Spry uses the default values.

You use forceFullPage when your layout is more important than the data. For example, if you don’t set this option, and the data set has 36 rows and a page size of 10, the last page shows only rows 30 to 36 (leading to a shorter output). If the forceFullPage option is set to true, however, the page displays 10 rows of data (27 to 36), which might duplicate rows 27 to 29 from the previous page.

Spry generally uses a zero-based counting system, but "Page 0" does not exist, so the Paged View data set uses a 1-based counting system instead. This simplifies using data references for paging. To use the standard zero-based counting system, set the useZeroBasedIndexes option to true. Remember that JavaScript is case sensitive.

Example

var pv1 = new Spry.Data.PagedView(ds1,{pageSize:20, forceFullPages:true, useZeroBasedIndexes:true});