簡體   English   中英

在SharePoint Designer 2010 AllItems.aspx xslt視圖中計算列

[英]Compute columns in SharePoint Designer 2010 AllItems.aspx xslt view

您能否幫助我實現以下目標:

我有3列(LinkTitle,Location,Location2)的自定義列表。 如果Location2列為空,則應從Location列獲取值

我做了以下,不起作用:

<xsl:template name="FieldRef_header.Location2" ddwrt:dvt_mode="header" match="FieldRef[@Name='Location2']" mode="header" ddwrt:ghost="hide">
<th nowrap="nowrap" scope="col" onmouseover="OnChildColumn(this)">
  <xsl:attribute name="class">
    <xsl:choose>
        <xsl:when test="@Location2 != ''">
            <xsl:value-of select="@Location2" />
        </xsl:when>
        <xsl:otherwise>
            <xsl:value-of select="@Location" />
        </xsl:otherwise>
    </xsl:choose>
  </xsl:attribute>
  <xsl:call-template name="dvt_headerfield.Location2">
    <xsl:with-param name="fieldname">
      <xsl:value-of select="@Name"/>
    </xsl:with-param>
    <xsl:with-param name="fieldtitle">
      <xsl:value-of select="@DisplayName"/>
    </xsl:with-param>
    <xsl:with-param name="displayname">
      <xsl:value-of select="@DisplayName"/>
    </xsl:with-param>
    <xsl:with-param name="fieldtype">
        <xsl:choose>
            <xsl:when test="@Type='Number' or @Type='Currency'">number</xsl:when>
            <xsl:otherwise>x:string</xsl:otherwise>
        </xsl:choose>
    </xsl:with-param>
  </xsl:call-template>
</th>

您不能使用計算類型和公式的其他“ 當前位置”列來執行此操作:

=IF( ISBLANK(Location2) , Location , Location2 )

那就是SharePoint方式

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM