我正在使用 SPRY 分页来对 XML 数据集进行分页。假设我在数据集中有数千行,那么 SPRY 分页显示 100 页。这迫使我的页面水平滚动,这是我不想要的效果。我怎样才能实现如下所示的或等效的东西:
<< < 1 2 3 4 5 .. 100 > >>
我已经尝试了好几天了。
请帮我解决。
谢谢
var myOspatches = new Spry.Data.XMLDataSet("include/myxml.xml", "system/ospatches/patch");
var myOspatchesPage = new Spry.Data.PagedView( myOspatches ,{ pageSize: pSize , forceFullPages:true, useZeroBasedIndexes:true});
var myOspatchesPageInfo = myOspatchesPage.getPagingInfo();
这是显示大量页面的分页
<table id="osPatchesPagination" style="width:100%;display: none;">
<tr>
<td align="left">
<!--<pre> <input type="button" class="btn" value="First" onclick="myOspatchesPage.firstPage();" /> <input type="button" class="btn" value="Prev" onclick="myOspatchesPage.previousPage();"/></pre>-->
<pre> <a href="javascript:myOspatchesPage.firstPage();"><<</a> <a href="javascript:myOspatchesPage.previousPage();"><</a> </pre>
</td>
<td align="center">
<span spry:region="myOspatchesPageInfo" spry:repeatchildren="myOspatchesPageInfo">
<a spry:if="{ds_CurrentRowNumber} != {ds_RowNumber}" href="#" onclick="myOspatchesPage.goToPage('{ds_PageNumber}')">{ds_PageNumber}</a>
<span spry:if="{ds_CurrentRowNumber} == {ds_RowNumber}" class="currentPage">{ds_PageNumber}</span>
</span>
</td>
<td align="right">
<pre> <a href="javascript:myOspatchesPage.nextPage();">></a> <a href="javascript:myOspatchesPage.lastPage();">>></a> </pre>
<!--<pre> <input type="button" class="btn" value="Next" onclick="myOspatchesPage.nextPage();" /> <input type="button" class="btn" value="Last" onclick="myOspatchesPage.lastPage();" /></pre>-->
</td>
</tr>
</table>