I can not find any documents about creating dojox / form / Uploader programs programmatically. I tried this on my own, but it looks like the plugin registration mechanism is somehow broken.
require([
"dojo/dom-construct",
"dijit/form/Button",
"dojox/form/Uploader",
"dojox/form/uploader/FileList",
"dojox/form/uploader/plugins/IFrame",
"dojo/domReady!"
], function(domConstruct, Button, Uploader, UploaderFileList) {
var form = domConstruct.create('form', {
method: 'post',
enctype: 'multipart/form-data',
class: 'Uploader'
}, document.body);
var up = new Uploader({
label: 'Pick files',
multiple: true,
url: '/echo/json/'
}).placeAt(form);
var list = new UploaderFileList({
uploader: up
}).placeAt(form);
var btn = new Button({
type: 'submit',
label: 'upload',
onClick: function() {
up.upload();
}
}).placeAt(form);
btn.startup();
up.startup();
list.startup();
});β
Jsfiddle example here .
As far as I understand, the source code is dojox / form / Uploader and dojox / form / uploader / plugins / IFrame, the plugin is registered through the dojox.form.addUploaderPlugin function, which overrides the loader class of the widget using its own and connected plugins as its predecessors. But the key method of βloadingβ the Uploader widget is never overridden by the HTML5 plugin (which is automatically included with the iframe plugin).
This is mistake? Or am I doing something wrong?
Thanks for any help!