|
fluid.pager(container, options); |
The container
parameter is is a selector, a single-element jQuery, or a DOM element specifying the root DOM node of the Pager markup.
The options
parameter is an optional collection of name-value pairs that configure the Pager, as described below in the Options section.
The Pager component fires the following events:
Event |
Type |
Description |
Parameters |
Parameter Description |
---|---|---|---|---|
|
default |
Fired whenever the pager's "model" changes - that is, whenever there is a change to the displayed range of data for the pager, caused by a change to the page index, page size or underlying data |
|
|
fluid.pager.next(); |
Selects the next page in the list of pages. If the current page is the last one, no action is taken.
fluid.pager.previous(); |
Selects the previous page in the list of pages. If the current page is the first one, no action is taken.
fluid.pager.selectPage(pageNum); |
Selects a particular page in the list of pages. If the given page number (pageNum
) is invalid, or is the same as the current page, no action is taken.
The following options to the creator function can be used to customize the behaviour of the Pager component:
Name |
Description |
Values |
Default |
|
---|---|---|---|---|
|
Javascript object containing selectors for various fragments of the Pager component. |
The object may contain any subset of the following keys: |
|
|
|
Javascript object containing CSS style names that will be applied to the Pager component. |
The object may contain any subset of the following keys: |
|
|
|
A function that will be called each time a new page has been selected. This function will most likely retrieve data for the selected page, or otherwise update the data. |
a function |
|
The Pager dependencies can be met by including the minified Fluid-all.js
file in the header of the HTML file:
<script type="text/javascript" src="Fluid-all.js"></script> |
Alternatively, the individual file requirements are:
<script type="text/javascript" src="jquery/jquery-1.2.6.js"></script> <script type="text/javascript" src="fluid/Fluid.js"></script> <script type="text/javascript" src="fluid/Pager.js"></script> |