0
我有一個自定義的DataViewWebPart,我想添加分頁。我已經包含了我正在使用的XSLT的肉來形成我的Web部分的細節範圍。有關如何在這個項目上實現分頁的任何建議(因爲我正在使用的密鑰,它不是很清楚)。SharePoint 2010將分頁添加到自定義DataViewWebPart
<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>
感謝您的幫助!