Copied to clipboard

Flag this post as spam?

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


  • Ayo Adesina 445 posts 1059 karma points
    Sep 06, 2017 @ 17:42
    Ayo Adesina
    0

    Complex Custom Tree Strcurture

    I have a pretty complex custom tree in a custom section in umbraco, its got 3 or 4 levels at some points and many diffrent 'node types' -

    I have sucessfully redered these - However I am finding creating the Angualr views and controllers to add/create and manage the data difficult.

    After a bit more research I am startnig to think should I be using more than one tree?

    At the moment I have got many many 'else if' statments like this:

         if (id == Constants.System.Root.ToInvariantString())
                {
    
    
                    var myNodes = new TreeNodeCollection();
    
                    foreach (var item in myService.GetAll(c => c.Brands))
                    {
    
                        var node = CreateTreeNode("opco-" + item .Id.ToString(), "-1", queryStrings, opco.Name, "icon-globe-alt", opco.Brands.Any());
    
                        myNodes.Add(node);
                    }
                    return myNodes;
    
                }
                else if (id.StartsWith("opco-"))
                {.....}else if 
    (id.StartsWith("nds-"))
    {}
    

    Is this incorrect, should I be using more than one tree............ one for each level?

    Or is this ok... I'm gettin more confused by the day. lol

  • Ayo Adesina 445 posts 1059 karma points
    Sep 06, 2017 @ 17:58
    Ayo Adesina
    0

    I still want the tree to appare as one tree with child nodes in the UI, but the question I'm trying to ask is should that one tree in the UI be made up of mulitple tree controllers?

Please Sign in or register to post replies

Write your reply to:

Draft