0
我正在使用YUI Paginator用于分页的API,我需要显示屏幕上的总页数。我看到在API中有一个函数getTotalPages(),但我不确定如何使用它,没有足够的文档。另外看过其他文档后,我尝试使用{totalPages},但没有奏效。 有人能帮我解决这个问题吗?提前致谢!! 以下是我正在使用的代码片段。请参考模板对象从配置:如何显示YUI Paginator中的页面总数?
config = {
rowsPerPage: 100,
template :
'<p class="klass">' +
'<label>Total pages: {totalPages}</label>'+
'<label>Page size: {RowsPerPageDropdown}</label>'+
'</p>',
rowsPerPageDropdownClass : "yui-pg-rpp-options",
rowsPerPageOptions : [
{ value : 100 , text : "100" },
{ value : 250 , text : "250" },
{ value : 500 , text : "500" },
{ value : 1000 , text : "1000" },
{ value : tstMap[tabName].length , text : "All" }
],
};
var myPaginator = new YAHOO.widget.Paginator(config);