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);