Copied to clipboard

Flag this post as spam?

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


  • Son Pham 31 posts 72 karma points
    Jun 09, 2015 @ 19:04
    Son Pham
    0

    Tree menu rendering problem

    I have a list of pages in Content. When user right click on one page, I add one more MenuItem on the top that will process by angular. The problem is if I selected page1 (id: 1122) and then I right-click on page4 (id: 1125). In my angular controller I still get $routeParams.id = 1122. It should be updated to 1125. 

    But If I make a left-click on page4 and then right-click. It will solve the problem. It looks like left-click to focus on that page to make Umbraco update client URL. So how can I set selected Item on page4 when I do a right-click. Or somehow I can get exactly id that selected by right-click in angular controller. Thanks

     private void TreeControllerBase_MenuRendering(TreeControllerBase sender, MenuRenderingEventArgs e)
    {
    var cs = new ContentService();
    int id;
    Int32.TryParse(e.NodeId, out id);
    if (id > 0 && cs.GetById(id).ContentType.Alias == "Partner")
    {
    var i = new MenuItem("createScaffold", "Create From Template");
    i.AdditionalData.Add("actionView", "../App_Plugins/CustomTemplateMenuTree/create.html");
    i.Icon = "home";
    e.Menu.Items.Insert(0, i);
    }
    }
Please Sign in or register to post replies

Write your reply to:

Draft