Closed KshitizGIT closed 7 years ago
You need to check dropzone documentation. All events and dropzone object are exposed.
I was facing the same "problem" today, so I found the following docs which points me to the right direction.
My config is the following:
public config: DropzoneConfigInterface = {
// ...
autoProcessQueue: false,
init: function() {
const dropzone: any = this;
document.querySelector('button[type=submit]').addEventListener('click', (event: MouseEvent) => {
event.preventDefault();
event.stopPropagation();
dropzone.processQueue();
});
};
@sconix thanks for writing this wrapper!
@rafaelss95 and anyone else who has this question the cleaner approach would be the following and they are using the component version.
@ViewChild(DropzoneComponent) componentRef: DropzoneComponent;
//process the queue this.componentRef.directiveRef.dropzone.processQueue();
Then you don't need the workaround listed above. --Steve
Quick edit to @sboyd's answer above, the snippet should be:
@ViewChild(DropzoneComponent) componentRef: DropzoneComponent;
this.componentRef.directiveRef.dropzone().processQueue();
This will get the dropzone instance.
@chenkie my guess is that it depends on the version of the wrapper you are using. I'm using version 4.x.x and the way I get the dropzone instance is what I'd posted in my comment. Now if you're using the same version of the wrapper I'm at a total loss :0)
Ah, I'm on v5. Thanks for clarifying :)
My bad....I should have stated that in the first place. Have a great day. --Steve
How do I manually process queues ? Is there a event exposed for this?