JangoSteve / remotipart

Rails jQuery file uploads via standard Rails "remote: true" forms.
http://os.alfajango.com/remotipart
Other
1k stars 215 forks source link

Not getting the ajax:remotipartComplete event #198

Open glappen opened 6 years ago

glappen commented 6 years ago

Hello,

I am trying this on latest version of Rails 5 (I just found out it was supported, so I got pretty far despite that!).

I am not getting the ajax:remotipartComplete event though when l listen for it like this:

 $('body').on('ajax:remotipartComplete', '.edit_question', function(e, data) {                                                                                                                                   
     $(window.activeQuestionDiv).replaceWith(data);                                                                                                                                                                
     $('#question-modal').modal('hide');                                                                                                                                                                           
  });

I set breakpoing in jquery.remotipart.js and this line does execute:

$.rails.fire(form, 'ajax:remotipartComplete', [data]);

But I can never receive that event, even if I register a listener directly on the form. Any ideas why? Getting ready to give up and resort to writing my own js to use FormData...thanks!

Greg