Picker说setEnableSharedDrives()不是函数

时间:2019-05-01 15:05:50

标签: google-picker

Picker reference已于4月24日更新。子类DocsView现在具有函数setEnableSharedDrives(),但是Picker引发异常并且不显示视图。

这是示例代码:

var view = new google.picker.DocsView(google.picker.ViewId.FOLDERS);
        view.setMode(google.picker.DocsViewMode.LIST);
        view.setIncludeFolders(true);
        view.setSelectFolderEnabled(true);
        view.setEnableSharedDrives(true);

        var picker = new google.picker.PickerBuilder()
          .addView(view)
          .enableFeature(google.picker.Feature.NAV_HIDDEN)
          .enableFeature(google.picker.Feature.SUPPORT_DRIVES)
          .hideTitleBar()
          .setSelectableMimeTypes("application/vnd.google-apps.folder")
          .setOAuthToken(token)
          .setDeveloperKey(DEVELOPER_KEY)
          .setCallback(pickerCallback)
          .setOrigin(google.script.host.origin)
          .setSize(DIALOG_DIMENSIONS.width - 2,
            DIALOG_DIMENSIONS.height - 2)
          .build();

        picker.setVisible(true);

1 个答案:

答案 0 :(得分:1)

将setEnableSharedDrives更改为setEnableDrives