John Lindal![]()
This is an unofficial port of YUI2 Paginator.
The code sample instantiates two paginators. The first one uses the defaults. The second one specifies a custom template and custom appearance for some of the components in the template.
<script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2010.06.23-18-37'
}).use('gallery-paginator', function(Y)
{
function update(
/* object */ state)
{
this.setPage(state.page, true);
this.setRowsPerPage(state.rowsPerPage, true);
}
var p1 = new Y.Paginator(
{
totalRecords: 25,
rowsPerPage:5
});
p1.on('changeRequest', update, p);
p1.render('#pg1');
var p2 = new Y.Paginator(
{
totalRecords: 25,
rowsPerPage:5,
template: '{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {ItemRangeDropdown} {NextPageLink} {LastPageLink}',
firstPageLinkLabel: '|<',
previousPageLinkLabel: '<',
nextPageLinkLabel: '>',
lastPageLinkLabel: '>|'
});
p2.on('changeRequest', update, p);
p2.render('#pg2');
});No forum posts for this module.
© 2010 YUI Library - Site Credits