Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropzone previewsContainer initialization

Tags:

dropzone.js

I'm using Dropzone.autoDiscover = false and I create my dropzones with element.dropzone(). I want to display the processed files in another container, so I used previewsContainer attribute. The files are appearing in that container but they're displaying badly, same as when dropzones are not properly initialized. So my question is : is there a way to initialize the preview containers?

Thanks in advance,

Nenos

like image 661
Nenos Avatar asked Sep 11 '26 12:09

Nenos


1 Answers

To display properly the dropzone previews container must also have the dropzone class despite not being mentioned in the documentation.

So it should look like this:

html:

<div class="dropzone" id="myDropzone"></div>

<div class="dropzone-previews dropzone"></div>

js:

Dropzone.autoDiscover = false;

$('#myDropzone').dropzone({
    previewsContainer: ".dropzone-previews",
    url: 'yoururl'
});
like image 60
wallek876 Avatar answered Sep 13 '26 07:09

wallek876