2010年8月20日 星期五

How to change SharePoint view to click title and enter edit mode

​Open your view in SPD, find these code:

<xsl:otherwise>
                <xsl:choose>
                      <xsl:when test="$XmlDefinition/List/@TemplateType != 301">
                  <a onfocus="OnLink(this)" href="{$FORM_DISPLAY}&amp;ID={$ID}&amp;ContentTypeID={$thisNode/@ContentTypeId}" onclick="EditLink2(this,{$ViewCounter});return false;" target="_self">
                          <xsl:call-template name="LinkTitleValue.LinkTitle">
                            <xsl:with-param name="thisNode" select="$thisNode"/>
                            <xsl:with-param name="ShowAccessibleIcon" select="$ShowAccessibleIcon"/>
                         </xsl:call-template>
                  </a>
              </xsl:when>
                      <xsl:otherwise>
                    <a onfocus="OnLink(this)" href="{$FORM_DISPLAY}&amp;ID={$ID}" onclick="GoToLink(this);return false;" target="_self">
                          <xsl:call-template name="LinkTitleValue.LinkTitle">
                            <xsl:with-param name="thisNode" select="$thisNode"/>
                            <xsl:with-param name="ShowAccessibleIcon" select="$ShowAccessibleIcon"/>
                         </xsl:call-template>
                  </a>
              </xsl:otherwise>


change to these code:

<xsl:otherwise>
                <xsl:choose>
                      <xsl:when test="$XmlDefinition/List/@TemplateType != 301">
                  <a onfocus="OnLink(this)" href="{$FORM_EDIT}&amp;ID={$ID}&amp;ContentTypeID={$thisNode/@ContentTypeId}" onclick="EditLink2(this,{$ViewCounter});return false;" target="_self">
                          <xsl:call-template name="LinkTitleValue.LinkTitle">
                            <xsl:with-param name="thisNode" select="$thisNode"/>
                            <xsl:with-param name="ShowAccessibleIcon" select="$ShowAccessibleIcon"/>
                         </xsl:call-template>
                  </a>
              </xsl:when>
                      <xsl:otherwise>
                    <a onfocus="OnLink(this)" href="{$FORM_EDIT}&amp;ID={$ID}" onclick="GoToLink(this);return false;" target="_self">
                          <xsl:call-template name="LinkTitleValue.LinkTitle">
                            <xsl:with-param name="thisNode" select="$thisNode"/>
                            <xsl:with-param name="ShowAccessibleIcon" select="$ShowAccessibleIcon"/>
                         </xsl:call-template>
                  </a>
              </xsl:otherwise>