locked
Change the title hyperlink associated with an ECB menu in a report library RRS feed

  • Question

    • Problem:  I need to change the title hyperlink associated with an ECB menu in a report library. The customer is uploading an Excel spreadsheet with links to SharePoint lists.  SP 07 doesn't support this and so when the user links on the ECB title SP tries to load the page in Excel Profile Page and it throws an error. 

     

    • What I have Done so Far:  Using Javascript and a CEWP I have already customized the ECB to remove the "Snap Shot in Excel" and "View in Browser" menu items in the ECB.  However I cannot hide the title menu item for obvious reasons.

     

     

    • Any suggestions would be greatly appreciated.

     

    <script type="text/javascript">
    
     var a_ =document.getElementsByTagName("a");
    
     for(i=0;i<=a_.length -1;i++)
    
     {
    
     a_[i].href=a_[i].href.replace("DispForm","EditForm");
    
     }
    
     </script>
    
    
    Thanks!
    Tom

    Tom Molskow - SharePoint Architect - Microsoft Community Contributor 2011 Award - Linked-In - SharePoint Gypsy
    Thursday, February 17, 2011 6:16 PM

Answers

  • Hello Community,

    OK, well I did find a way to do this.  Essentially, from SPD in the code behind view I discovered the following tag:

    <

     

    xsl:when test="@File_x0020_Type='xlsx'"><a ONCLICK="window.location='{$HttpVDir}/_layouts/ExcelProfilePage.aspx?ListId={$List}&amp;ID={$ID}'

    As you can see, this xsl:when condition checks for the file extension and if it equals a xslx or IOW an Excle file it will redirect to the ExcelProfilePage which then throws the error because the user is posting Excel Spreadsheets with SharePoint List links.  I changed the line above to the line below:

    <

     

    xsl:when test="@File_x0020_Type='xlsx'"><a ONCLICK="window.location='{$HttpVDir}/MyWebSite/Forms/EditForm.aspx?ID={@ID}'

    Now, when the user clicks on the title in the ECB they are redirected to the Edit Page - problem solved!

    I hope that helps!

    Tom


    Tom Molskow - SharePoint Architect - Microsoft Community Contributor 2011 Award - Linked-In - SharePoint Gypsy
    • Marked as answer by Tom Molskow Thursday, February 17, 2011 7:53 PM
    Thursday, February 17, 2011 7:53 PM