Navigation not possible when a parent is set in Google API picker (docsView)

126 Views Asked by At

I'm a bit stuck with the Google API and the Drive file picker.

I want the Drive file picker to open at a given location (folder) in Drive, but users should also be able to navigate outside that location anywhere else to select a file from any other location.

Using setParent() on the DocsView object, the picker does open with that "starting" folder. However, the navigation pane also disappears and it's not possible to get anywhere in the Drive (unless doing a search, but that's not obvious...).

For example when there is NO setParent() this what I got, after going inside the "starting" folder --> there is a navigation pane under the search area: enter image description here

But if I set a parent (using setParent()), then I have no more navigation pane, and I need it... enter image description here

This is how I create the builder:

const docsView = new google.picker.DocsView();
docsView.setMimeTypes("application/vnd.google-apps.folder" + ((this.showFolderOnly) ? "" : ",application/aspyre"));
if(this.appStore.initFolder != undefined){
    docsView.setParent(this.appStore.initFolder.toString());
}
const picker = new google.picker.PickerBuilder()
    .addView(docsView)
    .disableFeature(google.picker.Feature.MULTISELECT_ENABLED)
    .disableFeature(google.picker.Feature.NAV_HIDDEN)
    .setLocale(useStore().appLang)
    .setOAuthToken(this.oauthToken)
    .setDeveloperKey(this.devKey)
    .setCallback(this.pickerCallback)
    .build();
picker.setVisible(true);

Thanks a lot for your help, maybe I've missed something out the document but frankly... I don't know what...

Pierre

0

There are 0 best solutions below