Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In dojo 1.8, the uploader is not yet fully AMD compliant. So, in order to make the example from the trunk tests work in 1.8, you need to create the uploader programmatically using the dojox.form.Uploader constructor rather the required AMD module. As follows :</p> <pre><code>&lt;form method="post" action="UploadFile.php" id="myForm" enctype="multipart/form-data" &gt; &lt;fieldset&gt; &lt;legend&gt;DnD Test&lt;/legend&gt; &lt;input class="browseButton" id="uploader"/&gt; &lt;input type="submit" label="Submit" data-dojo-type="dijit/form/Button" /&gt; &lt;div id="files" data-dojo-type="dojox/form/uploader/FileList" data-dojo-props='uploaderId:"uploader"' &gt;&lt;/div&gt; &lt;/fieldset&gt; &lt;/form&gt; &lt;div id="dropTarget"&gt;Drop files here !&lt;/div&gt; </code></pre> <p>And in the javascript : </p> <pre><code>require([ 'dojo/parser', 'dojo/dom', 'dijit/registry', 'dojox/form/Uploader', 'dojox/form/uploader/FileList', 'dojox/form/uploader/plugins/HTML5', 'dojo/domReady!' ], function(parser, dom, registry, ready){ var dropTarget = dom.byId('dropTarget'), uploader; parser.parse().then(function(){ // You need to use dojox.form.Uploader, as in dojo 1.8, // the module is not fully AMD compliant yet. uploader = new dojox.form.Uploader({ name:'uploadedfile', label:'Select Some Files', multiple:true, force:'html5' }, 'uploader'); uploader.startup(); if(require.has('file-multiple')){ console.debug("Adding a new drop target"); registry.byId('uploader').addDropTarget(dropTarget); } }); }); </code></pre> <p>See <a href="http://jsfiddle.net/psoares/6r2jZ/" rel="nofollow">http://jsfiddle.net/psoares/6r2jZ/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload