Excel文件不显示在使用javascript的谷歌选择器中
问题描述:
我正在使用谷歌选择器API进行附件。 This is the google API library.Excel文件不显示在使用javascript的谷歌选择器中
我正在使用下面的代码在picker中显示文档。
var docsView = new google.picker.DocsView()
.setIncludeFolders(false)
.setMimeTypes('application/vnd.google-apps.folder,image/png,image/jpeg,image/jpg,text/plain,application/pdf,\n\
application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/x-vnd.oasis.opendocument.spreadsheet,\n\
text/csv,image/svg+xml,application/vnd.openxmlformats-officedocument.presentationml.presentation')
.setSelectFolderEnabled(false);
var picker = new google.picker.PickerBuilder()
.enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
.setAppId(appId)
.setOAuthToken(oauthToken)
.addView(docsView)
.addView(new google.picker.DocsUploadView())
//.setDeveloperKey(developerKey)
.setCallback(pickerCallback)
.build();
picker.setVisible(true);
此代码不显示这是created from the drive
该文档,它仅显示这是uploaded to drive
的文件。
有什么方法可以显示那些文件是created from the drive
?我查看了文档,但找不到对我有用的任何内容。
答
我只是代替下方视图状态视图:
// NEW VIEW
var docsView = new google.picker.DocsView(google.picker.ViewId.DOCS);
docsView.setIncludeFolders(true);
docsView.setSelectFolderEnabled(true);
// OLD VIEW
var docsView = new google.picker.DocsView()
.setIncludeFolders(false)
.setMimeTypes('application/vnd.google-apps.folder,image/png,image/jpeg,image/jpg,text/plain,application/pdf,\n\
application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/x-vnd.oasis.opendocument.spreadsheet,\n\
text/csv,image/svg+xml,application/vnd.openxmlformats-officedocument.presentationml.presentation')
.setSelectFolderEnabled(false);
// THIS CODE WILL BE SAME
var picker = new google.picker.PickerBuilder()
.enableFeature(google.picker.Feature.MULTISELECT_ENABLED)
.setAppId(appId)
.setOAuthToken(oauthToken)
.addView(docsView)
.addView(new google.picker.DocsUploadView())
//.setDeveloperKey(developerKey)
.setCallback(pickerCallback)
.build();
picker.setVisible(true);