我有一个自定义DataViewWebPart,我想添加分页。我已经包含了我正在使用的XSLT的内容,以形成下面我的Web部分的详细信息范围。关于如何在这个项目上实现分页的任何建议(因为我使用密钥对我来说不太清楚)。
<xsl:key name="casebystate" match="Row" use="@StoreState"/>
<xsl:template match="/">
<xsl:variable name="cbs_Rows" select="/dsQueryResponse/Rows/Row/@StoreState"/>
<table border="0" width="100%" cellpadding="2" cellspacing="0">
<tr valign="top">
<th class="ms-vh" nowrap="nowrap">State</th>
<th class="ms-vh" nowrap="nowrap">Totals</th>
</tr>
<xsl:for-each select="//Row[generate-id() = generate-id(key('casebystate', @StoreState)[1])]">
<xsl:sort select="@StoreState"/>
<xsl:for-each select="key('casebystate', @StoreState)">
<xsl:call-template name="CaseByState.rowview" />
</xsl:for-each>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template name="CaseByState.rowview">
<xsl:variable name="cbs_NewSortValue" select="ddwrt:NameChanged(string(@StoreState), 0)"/>
<xsl:if test="string-length($cbs_NewSortValue) > 0">
<tr id="group0{generate-id()}">
<td class="abh-chrtStatTitle">
<xsl:value-of select="@StoreState"/>
</td>
<td class="abh-chrtStatValue">
<xsl:value-of select="count(key('casebystate', @StoreState))"></xsl:value-of>
</td>
</tr>
</xsl:if>
</xsl:template>
提前感谢您的帮助!
答案 0 :(得分:0)
如果您使用的是Sharepoint Designer 2010,是否可以在设计器中选择dvwp,请转到数据视图工具部分,然后从功能区的选项选项卡中单击分页?这应该允许您为webpart指定分页。