Copied to clipboard

Flag this post as spam?

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


  • NDDT 68 posts 240 karma points c-trib
    Dec 06, 2016 @ 12:28
    NDDT
    0

    Context Menu for Custom Tree

    I'm using a custom tree to display and create data in the umbraco-backend.

    The Root-Node is always the same and has the ID "root". The Create-Action works for the root-Node and the children are created and displayed. But I don't know how to register a second create-method that does the same but looks up another Route.

    protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
        {
            var menu = new MenuItemCollection();
            if (id.Equals("root") || id.Equals("-1"))
            {
                menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
                menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
    
            }
            else
            {
                menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
    
            }
            return menu;
        }
    

    This doesnt work as it doesn't open a Dashboard like the CreatChildEntity-Action but shows my angular-code in a modal:

    menu.Items.Add(new MenuItem("createLocation", "Create Location"));
    
Please Sign in or register to post replies

Write your reply to:

Draft