Sharepoint list 自定义分页与GotoPage solution

来源:互联网 发布:灯光矩阵 编辑:程序博客网 时间:2024/05/23 02:05

 
Template for
<xsl:template name="for-loop">
 <xsl:param name="i"/>
 <xsl:param name="count"/>
 <xsl:param name="record"/>
 
 <xsl:variable name="GoRow">
  <xsl:value-of select="($i - 1) * $record +1" />
 </xsl:variable>
 <xsl:if test="$i &lt;= $count">
     <a>
      <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$GoRow,'}'))" />;</xsl:attribute>
   <xsl:value-of select="$i" disable-output-escaping = "yes" />
   <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
    </a>

 </xsl:if>
 <xsl:if test="$i &lt;= $count">
  <xsl:call-template name="for-loop">
   <xsl:with-param name="i">
    <xsl:value-of select="$i + 1"/>
   </xsl:with-param>
   <xsl:with-param name="count">
    <xsl:value-of select="$count"/>
   </xsl:with-param>
   <xsl:with-param name="record">
    <xsl:value-of select="$record" />
   </xsl:with-param>  
  </xsl:call-template>
 </xsl:if>
</xsl:template>

 

call template
    <xsl:variable name="TotalPage">
     <xsl:value-of select="$dvt_RowCount div $RowLimit" />
    </xsl:variable>


<xsl:call-template name="for-loop">
   <xsl:with-param name="i">1</xsl:with-param>
   <xsl:with-param name="count">
    <xsl:value-of select="$TotalPage" />
   </xsl:with-param>
   <xsl:with-param name="record">
    <xsl:value-of select="$RowLimit" />
   </xsl:with-param>
</xsl:call-template>

原创粉丝点击