ECB Menu Item Question RRS feed

  • Question

  • Here is my script for adding a new ECB menu item:

    function Custom_AddDocLibMenuItems(m, ctx)

    var rf = GetUrlKeyValue(‘RootFolder’);

    var strDisplayText = “Go to Url”;

    var strImagePath = “”;

    var strAction = ‘window.navigate(“/xxx/xxx//NewForm.aspx?Source=” + rf)’

    // Add our new menu item
    CAMOpt(m, strDisplayText, strAction, strImagePath);
    // add a separator to the menu
    // false means that the standard menu items should also be rendered
    return false;

    I want to direct the user to the url specified in window.navigate command, but for some reason when I click on the newly added item in the ECB menu, nothing happens (status bar just says ‘done’). When I take out the +rf in the var strAction = ‘window.navigate(“/xxx/xxx//NewForm.aspx?Source=” + rf)’ , the item will work and I will be directed to the url /xxx/xxx//NewForm.aspx?Source=”. So something is wrong with the variable rf part to get the value of RootFolder for redirection purpose, but I don’t know why. I still want to be able to direct user back to exactly where they are in the document library after they enter info in NewForm.aspx page, so that’s why I need the variable rf. Does anybody know why this script is not functioning as it should be with the variable rf in the strAction clause?

    • Edited by Mike Walsh FIN Monday, July 18, 2011 2:48 PM do not put your entire text in bold
    Monday, July 18, 2011 2:08 PM