Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1474 posts 3451 karma points c-trib
    Feb 22, 2011 @ 08:07
    Simon Dingley
    0

    Problems with custom tree context menus in 4.6.x

    I am just upgrading one of my packages to be 4.6.x compatable and having trouble getting the context menus working again - I'm sure I'm probably missing something really obvious but I fear its's now a case of not being able to see the wood for the trees.

    Here are the relevant properties in my IAction implementation:

    public string JsFunctionName
    {
        get
        {
            return "EditApp(nodeID)";
        }
    }
    
    public string JsSource
    {
        get { return "/umbraco/plugins/appmanager/appmanager.js"; }
    }

    Here is an example of the javascript function I was using for testing which is contained in appmanager.js:

    function EditApp(nodeID) {
        alert(nodeID);
    }

    I can confirm that the script is in the correct location and is being referenced in the UI but I never get the alert - what am I missing?

  • Bo Kingo Damgaard 157 posts 456 karma points
    Feb 22, 2011 @ 10:50
    Bo Kingo Damgaard
    0

    Hi Simon

    Have you tried to copy-paste the code into the JsSource return, instead of referencing the .js file?

    /Bo

  • Simon Dingley 1474 posts 3451 karma points c-trib
    Feb 22, 2011 @ 11:29
    Simon Dingley
    0

    That won't work unfortunately because JSSource will end up being written out to the UI like this:

    <script src="EditApp(nodeID)" type="text/javascript"></script>
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies