【问题标题】:Problem with sharepoint 2010 conditional formatting (setting color to text in rows)sharepoint 2010 条件格式的问题(将颜色设置为行中的文本)
【发布时间】:2011-05-25 03:25:09
【问题描述】:

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

这是条件码:

    <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>

谢谢。 加迪姆。

【问题讨论】:

    标签: sharepoint formatting moss conditional


    【解决方案1】:

    您必须在可以在视图标签下找到的视图字段中添加 findword 列

        <FieldRef  Name ="findWord" />
    

    下面提供了以 1 和 0 作为输入的选择列类型的工作语法

    <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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多