Copied to clipboard

Flag this post as spam?

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


  • greengiant83 88 posts 109 karma points
    Apr 27, 2011 @ 00:25
    greengiant83
    0

    How to get NodeID from custom IAction javascript method

    I am trying to get a custom context menu item working.  According to this page: http://our.umbraco.org/wiki/reference/backoffice-apis/tree-api-to-create-custom-treesapplications

    When my javascript method is called I should have access to NodeID and NodeType, but that does not seem to be the case.  My method code is:

     

    function editReport()

    {

        alert("testing");

        try

        {

            alert(NodeID);

        }

        catch (e)

        {

            alert("Error: " + e);

        }

    }

     

    Which is successfully called.  I get an alert saying "testing" as expected, but then instead of an alert with the Node's id I get an alert saying: "Error: NodeID is not defined"

    How can I access the Node ID so that I can tell what item to operate on?

  • Daniel Bardi 927 posts 2562 karma points
    Apr 27, 2011 @ 02:46
    Daniel Bardi
    2

    Call from js.. 

    var nodeId = UmbClientMgr.mainTree().getActionNode().nodeId;
    
  • 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