4

There were already a few questions like this, but the answers seemed to reference removing everything via the reset method.

What is the best way to remove a file entry from the file list? I am already handling the 'complete' event, and would like to remove the one specific file entry once it is successfully uploaded.

The reason for this is that I am using Fine Uploader in conjunction with another component that actually displays the uploaded files, however we want to use the power of Fine Uploader for all of the uploading and other advantageous features.

sthede
  • 914
  • 1
  • 8
  • 27

1 Answers1

4

Have you tried using the getItemByFileId method to get a handle on the file container in the UI?

callbacks: {
    onComplete: function(id) {
        qq(this.getItemByFileId(id)).remove();
    }
}
Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82
  • LOL, genius! Just for kicks that is exactly what I tried, and it seemed to work fine, just didn't know if it was appropriate. Thanks for the always quick responses. Code I used: .on('complete', function (event, id, name, response) {var $fileEl = $(this).fineUploaderS3("getItemByFileId", id); $fileEl.remove(); }) – sthede Apr 24 '14 at 20:44
  • Either will work, but bypassing the jQuery plug-in wrapper here is much easier on the eyes. If you aren't interested in late-bound event handlers, there's not a real good reason to use jQuery for your callback handlers. – Ray Nicholus Apr 24 '14 at 20:48
  • Is there any way to remove all files at a time, without passing id ? – Keval Patel Nov 05 '15 at 09:42