jQuery-File-Upload
jQuery-File-Upload copied to clipboard
Callback after bulk delete
Bulk delete implementation simply looks up delete buttons of selected items in file list and triggers click on them.
https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.fileupload-ui.js#L638
Would be great if the delete requests get tracked and an event gets fired after bulk deletion completes.
Usecase is reloading of some parts of the page after bulk delete.
Hi @rnixx and thanks for your suggestion.
While there is no event for bulk deletion, there are individual events for each file deletion (see UI events):
$('#fileupload')
.on('fileuploaddestroy', function (e, data) {/* ... */})
.on('fileuploaddestroyed', function (e, data) {/* ... */})
.on('fileuploaddestroyfailed', function (e, data) {/* ... */})
If you want to implement a bulk deletion trigger yourself, you could do so by making use of the above events and some shared state to see if any destroy request are in progress, similar to how the start/stop callbacks in the core library are implemented: https://github.com/blueimp/jQuery-File-Upload/blob/1c84ab1ed9e7547701222484e4e770bfeaa7862e/js/jquery.fileupload.js#L1047-L1050
I'll mark this as a feature request.