ncuesta / dropzonejs-rails

Spice your Rails apps with some Dropzone sugar!
http://rubygems.org/gems/dropzonejs-rails
MIT License
312 stars 56 forks source link

cannot trigger 'removedFile' event #26

Closed anklos closed 9 years ago

anklos commented 9 years ago

in my js file, I have set up something like this:

$(document).ready(function(){

  Dropzone.autoDiscover = false;

  var dropzone = new Dropzone (".dropzone", {
    maxFilesize: 256, // Set the maximum file size to 256 MB
    paramName: "document[attachment]", // Rails expects the file upload to be something like model[field_name]
    addRemoveLinks: true // Don't show remove links on dropzone itself.
  });

  dropzone.on("removedFile", function(file){
    alert('remove triggered');
  });

  dropzone.on("addedFile", function(file){
    alert('add triggered');
  });

  dropzone.on("success", function(file){
    alert('success triggered');
  });
});

I could get he success event, however I cannot get removedFile event when I delete the file from drop zone. Also it cannot trigger addedFile event even the file has been uploaded successfully to my server.

Is there anything I miss here? Thanks in advance.

ncuesta commented 9 years ago

Hi @anklos, it looks like an issue with Dropzone itself. You may want to head to their repo for this kind of problems.