public
Last active

  • Download Gist
Paginator factory method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
// Use case:
var myDataTable = new YAHOO.widget.DataTable(id,cols,source,{
paginator : YAHOO.foo.createPaginator({ containers : "bar" })
});
 
// Method definition
YAHOO.namespace('foo').createPaginator = function (cfg) {
return new YAHOO.widget.Paginator(
// Merge configuration from cfg into some defaults
YAHOO.lang.merge({
rowsPerPage : 5,
rowsPerPageOptions : [5,10,20,30,50,{value:"all",text:"Wszystkie"
}],
alwaysVisible : false,
firstPageLinkLabel : "<<",
previousPageLinkLabel : "<",
nextPageLinkLabel : ">",
lastPageLinkLabel : ">>",
template : "{CurrentPageReport}" + YAHOO.widget.Paginator.TEMPLATE_R
OWS_PER_PAGE,
pageReportTemplate : "<strong>{startRecord}</strong> - <strong>{endR
ecord}</strong> spo&#347;ród <strong>{totalRecords}</strong> egzemplarzy"
}, (YAHOO.lang.isObject(cfg) ? cfg : {})));
};

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.