Reputation: 51
I am trying to create a title with a delete button and it works well for me. How would I differentiate the event click? Meaning the user clicks on the delete button or the user click on the event itself?
Upvotes: 0
Views: 1462
Reputation: 100175
One option would be, add a unique class to the delete button, and use fullCalendar's eventClick() function. It has second parameter jsEvent
which holds the native javascript event. Using this jsEvent
you could check the target class , say you've added delete_btn
as the class of delete button, then do:
..
eventClick: function (calEvent, jsEvent, view) {
var $element = $(jsEvent.target);
if( $element.hasClass("delete_btn") ) {
//you clicked delete button
}
else {
//you clicked elsewhere in the event block
}
},
..
Note that this is not tested.
Upvotes: 1