SharePoint 2010:如何在ItemStyle.XSL文件中使用内容查询Webpart的'onmouseover'属性?

时间:2012-04-18 12:33:11

标签: sharepoint

我目前正在使用内容查询Webpart在SharePoint 2010中工作。 我只是想显示一个列表,但是当用户将鼠标悬停在项目上时,我希望他/她看到一个描述。我试图将'onmouseover'属性放在任何地方,但似乎没有任何效果。

到目前为止,这是我的代码:

<xsl:variable name="SafeLinkUrl">
    <xsl:call-template name="OuterTemplate.GetSafeLink">
            <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
    </xsl:call-template>
</xsl:variable>

<xsl:variable name="DisplayTitle">
    <xsl:call-template name="OuterTemplate.GetTitle">
        <xsl:with-param name="Title" select="@Title"/>
        <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
    </xsl:call-template>
</xsl:variable>

<xsl:variable name="Description">
        <xsl:value-of select="@Description" />
</xsl:variable>

<xsl:variable name="Start">
        <xsl:value-of select="ddwrt:FormatDateTime(string(@Start), 1033, 'H:mm')" />
</xsl:variable>

<xsl:variable name="End">
        <xsl:value-of select="ddwrt:FormatDateTime(string(@End), 1033, 'H:mm')" />
</xsl:variable>

<xsl:variable name="Speaker">
        <xsl:value-of select="@Speaker" />
</xsl:variable>

<xsl:variable name="tableStart">
    <xsl:if test="$CurPos = 1">
        <![CDATA[ 
        <table border=1 bgcolor=#CCFFFF>
          <tr>
            <td><b>Start</b></td>
            <td><b>End</b></td>
            <td><b>Title</b></td>
            <td><b>Speaker</b></td>
          </tr>   
        ]]>
    </xsl:if>
</xsl:variable>

<xsl:variable name="tableEnd">
    <xsl:if test="$CurPos = $Last">
        <![CDATA[ </table> ]]>
    </xsl:if>
</xsl:variable>

<xsl:comment>Start of HTML section</xsl:comment> 
<xsl:value-of select="$tableStart" disable-output-escaping="yes"/>

<tr>
  <td><b> <xsl:value-of select="$Start"/> </b></td>

  <td><b> <xsl:value-of select="$End"/> </b></td>

  <td style="width:500px"><b> <xsl:value-of select="$DisplayTitle"/></b></td>

  <td> <xsl:attribute name="onmouseover"> <xsl:value-of select="@Description"/> </xsl:attribute> </td>

  <td><b> <xsl:value-of select="$Speaker"/> </b></td>
</tr>

<xsl:value-of select="$tableEnd" disable-output-escaping="yes"/>

<xsl:variable name="SafeLinkUrl"> <xsl:call-template name="OuterTemplate.GetSafeLink"> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="DisplayTitle"> <xsl:call-template name="OuterTemplate.GetTitle"> <xsl:with-param name="Title" select="@Title"/> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="Description"> <xsl:value-of select="@Description" /> </xsl:variable> <xsl:variable name="Start"> <xsl:value-of select="ddwrt:FormatDateTime(string(@Start), 1033, 'H:mm')" /> </xsl:variable> <xsl:variable name="End"> <xsl:value-of select="ddwrt:FormatDateTime(string(@End), 1033, 'H:mm')" /> </xsl:variable> <xsl:variable name="Speaker"> <xsl:value-of select="@Speaker" /> </xsl:variable> <xsl:variable name="tableStart"> <xsl:if test="$CurPos = 1"> <![CDATA[ <table border=1 bgcolor=#CCFFFF> <tr> <td><b>Start</b></td> <td><b>End</b></td> <td><b>Title</b></td> <td><b>Speaker</b></td> </tr> ]]> </xsl:if> </xsl:variable> <xsl:variable name="tableEnd"> <xsl:if test="$CurPos = $Last"> <![CDATA[ </table> ]]> </xsl:if> </xsl:variable> <xsl:comment>Start of HTML section</xsl:comment> <xsl:value-of select="$tableStart" disable-output-escaping="yes"/> <tr> <td><b> <xsl:value-of select="$Start"/> </b></td> <td><b> <xsl:value-of select="$End"/> </b></td> <td style="width:500px"><b> <xsl:value-of select="$DisplayTitle"/></b></td> <td> <xsl:attribute name="onmouseover"> <xsl:value-of select="@Description"/> </xsl:attribute> </td> <td><b> <xsl:value-of select="$Speaker"/> </b></td> </tr> <xsl:value-of select="$tableEnd" disable-output-escaping="yes"/>

我在哪里放置'onmouseover'属性,以便当鼠标悬停在某个项目上时,它会显示说明?

提前致谢。

0 个答案:

没有答案