Question

We have these linked sharepoint lists:-

  1. Department list

  2. Category List >> has a lookup field to the Department list.

  3. Asset list >> has a lookup field to the Category list.

so is there a paid or free sharepoint apps which allow me to show a tree-like map for the above lists? so it will show departments as the root and on each root it will show the related categories and within each category it will show the related assets?

Thank

No correct solution

OTHER TIPS

Every application (SharePoint/Standalone) that I need to show tree view, before front-end developing, it's necessary to model the data structure to reflect this requirement; for example, to extract all planning data to tree, for example, using C# entities to make this:

public class Department
{
    public Guid ID { get; set; }
    public List<Category> Categories { get; set; }
}
public class Category
{
    public Guid ID { get; set; }
    public List<Asset> Assets { get; set; }
}
public class Asset
{
    public Guid ID { get; set; }
    public SomeData SomeData { get; set; }
}

After this, generate a logic to make recursively queries do assign tree collection, in this case bellow, uses multidimensional array approach:

 public List<Department> TreeCollection { get; set; } = new List<Department>();
 public void GetDataRecursively()
 {
     using(SPSite site = new SPSite(url))
     {
         using(SPWeb web = site.OpenWeb())
         {
             SPList department = web.Lists["Department"];
             SPList category = web.Lists["Category"];
             SPList asset = web.Lists["Asset"];
             foreach(SPListItem dItem in department.Items)
             {
                this.TreeCollection.Add(new Department()
                {
                   ID = dItem.ID,
                   Categories = new List<Category>()
                });
                foreach(SPListItem cItem in category.Items)
                {
                   if(cItem["Department"] == dItem.ID)
                   {
                      this.TreeCollection.First(t => t.ID == dItem.ID).Add(new Department()
                      {
                         ID = cItem.ID,
                         Assets = new List<Asset>()
                      });
                   }
                   foreach(SPListItem aItem in asset.Items)
                   {
                      if(aItem["Category"] == cItem.ID)
                      {
                         this.TreeCollection.First(t => t.ID == dItem.ID).Categories
                           .First(c => c.ID == cItem.ID).Add(new Asset()
                         {
                           ID = aItem.ID,
                           SomeData = aItem["SomeData"]
                         });
                      }
                   }
                }
             }
         }
     }
 }

Make logic approach with this arrange, provide you to generate any choice of Front-End that render tree-view interface.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top