sharepoint 2010 条件格式问题(设置行中文本的颜色)

发布于 2024-10-07 20:04:21 字数 513 浏览 8 评论 0原文

我正在尝试为共享点列表(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>

谢谢。 加迪姆。

i'm tring to set conditional formatting for sharepoint list (2010).
I have a list with a few columns. One of them have 2 values available. 1 or 0.
if 1 then the text in all rows in my list must get color RED.
if 0 then do nothing.
in design mode in sharepoint designer i can see the color red, but the browser doesnt show it at all!
is this a bug of sharepoint? does the code created is not vaild code for browsers?

this is the condition code:

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

thanks.
gadym.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

裂开嘴轻声笑有多痛 2024-10-14 20:04:21

您必须在视场中添加 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>

You have to add findword column in viewfields which you can find under view tag

    <FieldRef  Name ="findWord" />

Working Syntax is provided below for choice column type taking 1 and 0 as input

<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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文