3

I am trying to display 5 levels of document library in a tree view to show all the files within all folders and sub folders. How can I achieve this task?

1
  • Is your folder quantity fixed or folders will be added/deleted anytime? Oct 31, 2018 at 18:12

2 Answers 2

0

You can use server side object model for this.

There is very good example of your problem:

http://www.codeproject.com/Articles/37530/Document-Library-Tree-View-Web-Part-for-SharePoint

6
  • I am aware of this URL and it is not a feasible solution for my requirement as I need to host my library in Office 365(it contains some of the namespaces are not allowed in Cloud).
    – Ram
    May 20, 2014 at 11:22
  • I was not aware you are using Sharepoint online. You can use client object model for this.
    – Aanchal
    May 20, 2014 at 11:28
  • Also check: community.office365.com/en-us/f/154/t/20212.aspx
    – Aanchal
    May 20, 2014 at 11:31
  • The above URL is also redirecting to the codeproject URL which you have mentioned. I am trying to display this in a web part.
    – Ram
    May 20, 2014 at 11:38
  • So, In sahrepoint online you need to use Sharepoint CSOM and iterate through all the documents and folders and bind that to your treeview. There is no out of the box solution for this.
    – Aanchal
    May 20, 2014 at 11:59
0

Sometime back I created a tree view collapsible menu for SharePoint Online. Following is the URL

http://dinushaonline.blogspot.com/2012/06/accordion-style-collapsible-menu-for.html

However try to use PnP JavaScript embed instead on directly modifying the masterpage.

https://github.com/SharePoint/PnP/tree/master/Samples/Core.EmbedJavaScript

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.