Content Picker questions
RéponduHi,
I have a couple questions.
1. Is there a way to show the content picker in a modal window via javascript? I see that you can make it show a button to open a modal window, but what if I want to skip the button step entirely?
2. Is there a mode that allows selection of both files and folders?
Thanks in advance,
Jamie
-
1. That is something you will have to implement yourself. You can do something like
window.open('https://codepen.io/box-platform/live/PWPxBm', 'sdfsdf', "width=800,height=600')
However you will have to also write some code to pass data from the modal to the parent window via postMessage (https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) or window.opener (https://developer.mozilla.org/en-US/docs/Web/API/Window/opener) or some other mechanism, so that what the content picker chooses, gets sent back to your code that opened the popup.
2. Use ContentPicker parent class instead of FolderPicker or FilePicker. It accepts a type option which can be 'file,folder,web_link'
var contentPicker = new Box.ContentPicker();
contentPicker
.show(folderId, accessToken, { type: 'file,folder,web_link' });
-
Hi and
Have you checked out this article here?
-
FilePicker is the same as ContentPicker with type='file' hardcoded.
FolderPicker is the same as ContentPicker with type='folder' hardcoded.
And in ContentPicker you can just specify the type you want, comma separated list.
I probably should add it to the documentation.
Vous devez vous connecter pour laisser un commentaire.
Commentaires
6 commentaires