Google Drive Picker: Show only top level folders

邮差的信 提交于 2020-12-07 04:37:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!