jquery - Adding queuecomplete to dropzone.js -


i have been trying figure our how add queuecomplete callback option dropzone.js. read dropzone.js - how after files uploaded shows couple options, not understand where/how implement this. tried adding code after reference dropzone.js, in dropzone.js, etc no luck. trying make simple minimal form dropzone class.

i tried:

dropzone.options.filedrop = {   init: function () {     this.on("complete", function (file) {       if (this.getuploadingfiles().length === 0 && this.getqueuedfiles().length === 0) {         dosomething();       }     });   } }; 

and also

this.on("queuecomplete", function (file) {      alert("all files have uploaded "); }); 

but keep getting dropzone not defined.

i think need know how implement this.

you must add javascript file first, , after script working with.

<script src="./path/to/dropzone.js"></script> <script> dropzone.options.filedrop = {   init: function () {       this.on("queuecomplete", function (file) {           alert("all files have uploaded ");       });   } }; </script> 

below working snnipet don't give error (you can't upload on stackoverflow because action don't exist)

dropzone.options.filedrop = {    init: function () {        this.on("queuecomplete", function (file) {            alert("all files have uploaded ");        });    }  };
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/dropzone.js"></script>  <link rel="stylesheet" href="https://rawgit.com/enyo/dropzone/master/dist/dropzone.css">      <p>    minimal example of dropzone. upload in example    doesn't work, because there no actual server handle file upload.  </p>    <!-- change /upload-target upload address -->  <form action="/upload-target" class="dropzone"></form>

note: if using jquery can add code inside $(document).ready(function { /* add here */ });.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -