简体   繁体   中英

Blueimp jQuery File Upload - hide file from queue after upload done responce

I'm using Blueimp jQuery File Upload plugin and my configuration is:

$('#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
    }
});

When one file upload is done, I need to hide this file from list in done: event, but I cant get index of this file in queue list.

Any ideas?

Found a solution regarding my question.

jQuery Fileupload returns data on done event, which contains context parameter per uploaded thread, which is relevant to DOM element and can be used for any manipulations like hiding in my case:

 $('#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);
    }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM