I've been using dropzone.js in some projects recently and configuring options without no problem, but in a new project I was using a recent version of jQuery (3.1.0) auto-installed by Zend Framework 3 and it appears to cause some kind of conflict with dropzone.js version 4.3.0.
I was not able to configure options for my dropzone, it is always using default options.
I've been using dropzone.js in some projects recently and configuring options without no problem, but in a new project I was using a recent version of jQuery (3.1.0) auto-installed by Zend Framework 3 and it appears to cause some kind of conflict with dropzone.js version 4.3.0.
I was not able to configure options for my dropzone, it is always using default options.
Share Improve this question edited Oct 6, 2016 at 9:50 Deeptechtons 11.1k27 gold badges105 silver badges178 bronze badges asked Oct 6, 2016 at 7:42 jairusgrjairusgr 1472 silver badges9 bronze badges 3- You need to send that error. It works great with latest version. need to know whats causing the issue? – Asmarah Commented Oct 6, 2016 at 7:48
- The problem is that there is no errors, even in the console. It is just that options are always set to default. I bypass the rest of the scripts and css files and leave only jquery and dropzone, but the result is the same. If you know any way to get errors, please tell me and I'll do my best. Thanks – jairusgr Commented Oct 7, 2016 at 16:51
- Deeptechtons, thanks for the correction :-) – jairusgr Commented Oct 7, 2016 at 16:53
3 Answers
Reset to default 6If anyone else needs to use Dropzone with jQuery 3, particularly if you need to reference jQuery methods within Dropzone's callbacks, here's what worked for me:
// Do this outside of jQuery
Dropzone.autoDiscover = false;
// Start jQuery stuff
$(function() {
// Call Dropzone manually
$("#dropzone").dropzone({
paramName: "image",
maxFilesize: 8, // MB
queueplete: function() {
// Some more jQuery stuff inside Dropzone's callback
$("#some_id").somejQueryMethod();
}
});
});
Afer half hour searching i found problem it works if declare befor
$(document).ready(function () {});
or
$(function () {...});
beacuse dropzone initiate befor jquery load methodes
My solution, of course have been to e back to an older version of jQuery, which is enough for me (1.11.1).
Hope this helps, and if anyone knows the reason of the conflict, cool!
Regards