javascript - FullCalendar removing only one event -


my question why code doesn't remove single event, @ once, whereas firing event (so id).

attaching click event on icon when rendering event :

   eventrender: function(event, element) {  //console.log(event);  if (event.type != "itineraire")     element.find('.fc-title').append('<span class="removeevent fa fa-trash pull-right"></span>');       element.find(".fa-trash").click(function() {         app.removeevent(event._id);       });   }, 

the app.removeevent(id) function:

removeevent(id){   console.log("we remove id " + id);   $('#calendarcontainer').fullcalendar('removeevents',id); } 

try this.

removeevent(id){     console.log("we remove id " + id);     $('#calendarcontainer').fullcalendar( 'removeevents', function(event) {         return (event._id == id);     }); } 

this works me.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -