2010-12-14 41 views
0

我正在为Sharepoint列表(2010)设置条件格式。 我有一个列有几列。其中一个有2个可用值。 1或0. 如果1,那么我列表中所有行中的文本必须为红色。 如果0则什么也不做。 在Sharepoint设计师的设计模式中,我可以看到红色,但浏览器根本不显示它! 这是一个共享点的错误?创建的代码不是浏览器的vaild代码吗?Sharepoint 2010条件格式问题(将颜色设置为行中的文本)

这是条件代码:

<xsl:if test="$thisNode/@findWord = '1'" 
ddwrt:cf_explicit="1" 
xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"> 
    color: #FF0000; font-family: Arial, Helvetica, sans-serif; font-weight: bold; 
     text-decoration: underline; 
</xsl:if> 

感谢。 gadym。

回答

2

你必须在viewfields您可以在视图标签

<FieldRef Name ="findWord" /> 

工作语法找到下面提供了选择列类型以1和0作为输入添加findword列

<xsl:variable name="titlevalue" select="$thisNode/@Title"/> 
     <xsl:choose> 
     <xsl:when test="$titlevalue=''"> 
     <xsl:value-of select="'(no title)'"/> 
     </xsl:when> 
     <xsl:otherwise> 
      <xsl:choose> 
       <xsl:when test="$HasTitleField"> 
      <span> 
     <xsl:attribute name="style"> 
     <xsl:if test="normalize-space($thisNode/@findWord) = '1'" ddwrt:cf_explicit="1">font-family: Arial, Helvetica, sans-serif; color: #FF0000; text-decoration: underline; font-weight: bold; background-color: #BDDFD9;</xsl:if> 
     </xsl:attribute> 
     <xsl:value-of disable-output-escaping="yes" select="$titlevalue" /> 
     </span></xsl:when> 
       <xsl:otherwise> 
      <xsl:value-of select="$titlevalue" /> 
      </xsl:otherwise> 
      </xsl:choose> 
     </xsl:otherwise> 
     </xsl:choose> 
相关问题