inlineContainer option of Upload Widget seems broken
Hi,
considering the code I've posted at https://jsfiddle.net/afoeder/amqnwjbu/, there is an error message saying »'inlineContainer' param must either be a valid HTMLElement or a selector string«, however, this of course is a selector string.
When using document.getElementById however (https://jsfiddle.net/afoeder/amqnwjbu/2/), the inlineContainer is disregarded althogether and it opens in a modal as if it wasn't set. Am I doing it wrong?
-
Hi Adrian,
Thanks for contacting us and providing an example.
I've had a look and the reason you're experiencing this behaviour is that when the code reaches the call to createUploadWidget() the DOM tree does not yet know about the <div> tag with ID lewidget.
Your selector example (https://jsfiddle.net/afoeder/amqnwjbu/) fails explicitly as it tries to match an element at that point, whereas the second example (https://jsfiddle.net/afoeder/amqnwjbu/2/) is handled slightly differently and when an element cannot be found via getElementById it defaults to a model.
I've modified your example a little by moving the call to createUploadWidget till after the DOM loads all the elements. https://jsfiddle.net/pyj9w0ke/
You can also replace the selector in my example above to use getElementById and it should also give you what you're looking for.
Please give this a try and let me know how it goes.
Regards,
Aleksandar
0
Post is closed for comments.
Comments
1 comment