YUI Library Examples: DataTable Control (beta): Configuring the Paginator

DataTable Control (beta): Configuring the Paginator

This example demonstrates the various configuration options for the YAHOO.widget.Paginator class included with the DataTable. Note that all navigation in the left column is generated by the Paginator.

Customizing pagination

Besides the normal configurations for pagination, we'll demonstrate the use of the other Paginator configuration options. Most notably, we'll use the template and pageLabelBuilder options to render the pagination controls in a custom layout with more descriptive page links.

Markup

CSS

Code

We'll start by making sure our data is in order, then define the function that we'll use to populate the page links.

We'll assign something to every available Paginator configuration key, if even the default value, just for illustration.

Beyond this, it's simply a matter of creating your DataTable as normal.

Copyright © 2008 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings