javascript - Add JS function on dynamically called element(html) fullcalendar -


I have a eventClick function on jQuery fullcalendar,

this idea That is when I click on my event, it opens a model box and from there I can remove the incident.

In addition to this I have removed the incidents with leaving it on the garbage, but when I take the event out of the full calendar material hides from me, I fc-view: overflow: visible; but nothing was able to help it, so I am trying to delete after opening the modal box.

  eventClick: function (calEvent, jsEvent, view) {var modal = '& lt; Div class = "modal fade" & gt; + '& Lt; Div class = "modal-dialog" & gt; + '& Lt; Div class = "modal-content" & gt; '+' & Lt; Div class = "modal-header" & gt; '+' & Lt; Button type = "button" class = "close" data-rejected = "modal" aria-hidden = "true" & gt; & Amp; times; & Lt; / Button & gt; '+' & Lt; H4 class = "modal-title" & gt; + CalEvent.title + '& lt; / H4 & gt; ' + '& Lt; / Div> + '& Lt; Div class = "modal-body"> gt; + '& Lt; Form class = "separate-sections" method = "post" & gt; + '& Lt; Div class = "form-group input-append calendar_time_pick" & gt; + '& Lt; Div class = "input group addon-dite" onclick = "showdate ()" & gt; '+' & Lt; Span class = "input-group-addon add-on" & gt; '+' & Lt; I data-time-icon = "icon-time" data -date-icon = "icon-calendar" class = "icon-time" & gt; & Lt; / I & gt; '+' & Lt; / Span & gt; '+' & Lt; Input Data-Format = "yyyy-MM-dd hh-mm-ss" type = "text" name = "date" placeholder = "time" & gt; & Lt; / Input & gt; '+' & Lt; / Div & gt; '+' & Lt; / Div & gt; '+ & Lt; Div & gt; '+' & Lt; Button class = "btn btn-btn-block" & gt; Save & lt; I class = "icon-save" & gt; & Lt; / I & gt; & Lt; / Button & gt; '+' & Lt; / Div> '+' & Lt; / Form & gt; '+' & Lt; / Div & gt; '+' & Lt; Div class = "modal-footer" & gt; '+' & Lt; Button ID = "submit" type = "button" Class = "btn btn-default" data-rejected = "model" & gt; Close & lt; / Button & gt; '+' & Lt; Button type = "button" onclick = "deleteEvent ('+ calEvent.id +')" class = "btn btn-primary"> Remove & lt; / Button & gt; '+' & Lt; / Div & gt; '+' & Lt; / Div & gt; '+' & Lt; / Div & gt; '+' & Lt; / Div & gt; '; $ (Modal) .modal ('show'); },  

and I have deleted the function

  var deleteEvent = function (id) {$ ('# calendar'). FullCalendar ('removeEvents', ID); }  

But that does not work, because when all JS loads, the model is not shown and this is the reason why it can not run that function later.


Comments