【问题标题】:SharePoint 2010 Add Paging to Custom DataViewWebPartSharePoint 2010 将分页添加到自定义 DataViewWebPart
【发布时间】:2012-07-02 18:46:50
【问题描述】:

我有一个要添加分页的自定义 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) &gt; 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>

提前感谢您的帮助!

【问题讨论】:

    标签: xslt sharepoint-2010 sharepoint-designer dataviewwebpart


    【解决方案1】:

    如果您使用的是 Sharepoint Designer 2010,您是否可以在设计器中选择您的 dvwp,转到数据视图工具部分并从功能区的选项选项卡中单击分页?这应该允许您为您的 webpart 指定分页。

    【讨论】:

      猜你喜欢
      • 2011-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-06
      • 1970-01-01
      • 2021-10-08
      相关资源
      最近更新 更多