Pager OverviewThe Pager component allows users to break up long lists of items into separate pages. Currently, the Pager is entirely mark-up driven, and has limited functionality. Future releases will incorporate additional features. Markup assumptionsUnlike many other Fluid Components, the Pager makes certain assumptions about the mark-up:
The Pager uses CSS selectors to access these various components. Default selectors are assumed, which can be overriden (see options below). |
On This Page See Also Still need help? Join the fluid-talk mailing list |
Constructor
fluid.Pager(componentContainerId, options);
Parameters
componentContainerId
The componentContainerId parameter is the ID of the root DOM node of the Pager markup.
options
The options parameter is an optional collection of name-value pairs that configure the Pager:
| Name | Description | Values | Default |
|---|---|---|---|
| selectors | Javascript object containing selectors for various fragments of the Pager component. | The object may contain any subset of the following keys: pagerTop pagerBottom pageLinks previous next Any values not provided will revert to the default. |
selectors: {
pagerTop: ".pager-top",
pagerBottom: ".pager-bottom",
pageLinks: ".page-link",
previous: ".previous",
next: ".next"
}
|
| styles | Javascript object containing CSS style names that will be applied to the Pager component. | The object may contain any subset of the following keys: currentPage disabled Any values not provided will revert to the default. |
styles: {
currentPage: "current-page",
disabled: "disabled"
}
|
| pageWillChange | 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 | pageWillChange: function (link) {
}
|
Functions
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.
Dependencies
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>