问题
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.
回答1:
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.
回答2:
For reference. This works fine now:
let docsView = new google.picker.DocsView(google.picker.ViewId.FOLDERS)
.setParent('root')
.setSelectFolderEnabled(true);
来源:https://stackoverflow.com/questions/33657864/google-drive-picker-show-only-top-level-folders