How to reset the files-list? #1631
Comments
<button id="clear_uploads" type="button" class="btn btn-info clear">
<i class="icon-ok icon-white"></i>
<span>Clear</span>
</button> $(function () {
$('#clear_uploads').click(function(){
$('#fileupload table tbody tr.template-download').remove();
});
}); |
I know this is not the place to ask it, but a simple answer besides a link the support guidelines would be great... The question is there, asked more than twice, but no answers. d3xtro approach isn't useful because it removes the rows from the table, but the file list is still full. It's a pretty simple and common question for a common question/task. It should be explained clearly somewhere in the docs... |
|
Thanks a lot for helping, d3x7ro. Unfortunately, it's not useful for me because I don't even have a "delete" button. I just plain need to empty the file list, which is not the same as firing the click event on that button. I already am using a similar approach than you - I delete the table rows of the uploaded files (in my case, just a single file). Then, after the file has been sent, I'd like to reset the list since I'm only allowing one file upload (limited via the "maxNumberOfFiles" option) and after it is selected it won't allow me to use any other one, no matter if they have been sent. I want to get rid of the delete button because my form only allows to upload one file each time the entire form is submitted, so there's no need for an extra cancel button: if the user wants to cancel the file upload, he/she just don't have to send the form. By the way, I'm using the jQuery UI branch, which is a bit outdated. |
Why are you even using this library? Just use a normal file upload. |
It's easy: I want/need to upload files through ajax. |
Why are you even using a website for this? Just have them fax the file to you. |
lol @ tomwade3 |
Hi there,
is there a function I can call from somewhere in my jquery-code that resets the file-list to 0 entries?
How can I access the object containing the file-list directly to get f.ex. the third entry?
Thanks
The text was updated successfully, but these errors were encountered: