user4565857
user4565857

Reputation: 155

blueimp jquery-file-upload how to detect pushing cancel button?

Using blueimp jquery-file-upload, I'd like to change a variable when clicking the cancel button.
The cancel button is displayed at right of the each file added.

I tried below but nothing has been happend.
How can I do this?

$(function () {
  var file_count = 0
  $('#fileupload').fileupload({
    acceptFileTypes: /(\.|\/)(pdf|PDF)$/i        
  }).bind('fileuploadadd', function (e, data) {
    file_count += data.files.length
    $('td.cancel button.btn-warning').click(function (e) {
      file_count -= 1
    });
  });
});

Upvotes: 2

Views: 545

Answers (1)

Oleg Sh
Oleg Sh

Reputation: 9013

just try it:

        $('body').on('click', 'button.cancel', function(e,data) {
            console.log('cancel click');
        });

Upvotes: 1

Related Questions