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.5.1/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2012.09.26-20-36'
}).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');
});
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info