Closed leafiy closed 6 years ago
Closing the issue. Newest release includes this.
The difference of what was originally on the devel branch is:
$('#drag-and-drop-zone').dmUploader('cancel', id);
or to do it 'globally', use it without a file ID:
$('#drag-and-drop-zone').dmUploader('cancel');
More info on the Readme.md, or the online demos.
This is supported in devel branch but with some limitations so I decided to modify the code to add a callback method.
Here you go https://gist.github.com/gficher/27a77b5040cf32d7ab92c9ccfcd5d5aa
How to use it? Good question.
The plugin calls onUploadCancel when a upload is aborted.
How do I abort it then? Another good question.
You should use your drag-and-drop element like this:
The ID is a number and not the row ID, so use a integer (from 0 to n)
But how can I get the ID? You are full of good questions!
Just add a button to your file row and bind an event to it
Where did data-id come from?
To get thinks easier, add this attr to the file row like this:
How can I abort the entire queue?
Just run this little puppy