Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Dropzone Instance/Object using jQuery

I use jQuery to work with dropzone. e.g.

$("#mydropzone").dropzone({ /*options*/ });

I need to get the Dropzone instance so I can call this method:

myDropzone.processQueue()

How can I achieve this? Is it possible?

in other words, how can I initialise drop zone using

$("#mydropzone").dropzone({ url: "/file/post" });

but at the same time get the instance of the object as if i initialise it using:

var myDropzone = new Dropzone("#mydropzone", { url: "/file/post"});

so I may call:

myDropzone.processQueue()

Thank you very much.

like image 715
preston Avatar asked Sep 05 '25 09:09

preston


1 Answers

As described in issue #180

You can also use the built in Dropzone.forElement function.

var myDropzone = Dropzone.forElement("#mydropzone");
like image 79
cweston Avatar answered Sep 08 '25 13:09

cweston