1
votes

Currently I am using google.picker.​ViewId.FOLDERS view in Google drive picker. This however, shows all the folders(including deep level folders) in my drive.

How to achieve a view in which only the top level folders are displayed at first? This would be similar to Dropbox chooser's file view.

2
you could use ".addView(new google.picker.DocsView().setParent('root').setIncludeFolders(true))". This will show the elements at root level, although it will show files as well.Gerardo
This is exactly what I need. However, it seems that the search doesn't search in deep levels after applying this. Is there a way to overcome this issue?Shyamal Parikh
your are right. try this one .addView(new google.picker.DocsView().setIncludeFolders(true).setOwnedByMe(true)). I was able to search files in deep levelsGerardo
Thanks a lot! It works perfectly now. This solution should be the final answer to the question.Shyamal Parikh

2 Answers

6
votes

For reference. This works fine now:

 let docsView = new google.picker.DocsView(google.picker.ViewId.FOLDERS)
                            .setParent('root')
                            .setSelectFolderEnabled(true);
4
votes

In order to see the folders and files at root level, you can use the view: addView(new google.picker.DocsView().setIncludeFolders(true).setOwnedByMe(true))

You will be able to search for items in deeper levels.