请给我一个实现以下分页的想法。
1 2 3 4 5 next>> 假设如果您单击"next>>“,它将显示下一组分页,如下所示
6 7 8 9 10 next>> 控件应该在第6页。
场景:
1 2 3 4 5 next>> 如果我们在任何一个页面中,并单击next>>,应该转到第6页,即下一组的第一页
ex:如果我们在第2页,next>>应该转到第6页还是第3页,next>>应该转到第6页??
提前谢谢。
发布于 2015-08-04 09:21:32
如果您签出pagingbar.isml,有几个有用的片段
current = pdict.pagingmodel.start;
totalCount = pdict.pagingmodel.count;
pageSize = pdict.pagingmodel.pageSize;
pageURL = pdict.pageurl;
currentPage = pdict.pagingmodel.currentPage;
maxPage = pdict.pagingmodel.maxPage;然后,您可以定义下一组分页。
lr = 2; // number of explicit page links to the left and right
if ( maxPage <= 2*lr )
{
rangeBegin = 0;
rangeEnd = maxPage;
}
else
{
rangeBegin = Math.max( Math.min( currentPage - lr, maxPage - 2*lr ), 0 );
rangeEnd = Math.min( (rangeBegin + (2*lr)), maxPage );
}https://stackoverflow.com/questions/27214409
复制相似问题