Blueimp jQuery文件上传 – 在上传完成响应后从队列中隐藏文件

我正在使用Blueimp jQuery File Upload插件,我的配置是:

$('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: 'assets/plugins/jquery-file-upload/server/php/', done: function (e, data) { //some code } }); 

当一个文件上传完成后,我需要在done: event中从列表中隐藏这个文件,但是我无法在队列列表中获得该文件的索引。

有任何想法吗?

找到关于我的问题的解决方案。

jQuery Fileupload返回done事件的数据,其中包含每个上传线程的context参数,该参数与DOM元素相关,可用于隐藏在我的案例中的任何操作:

  $('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: 'assets/plugins/jquery-file-upload/server/php/', done: function(e, data) { //hide completed upload element in queue $(data.context['0']).fadeOut(700); //here isoutput of uploaded objects console.log(data.result); } });