I managed to do this the other day...
In your Calendar object you need an action assigned to the OnSelectEvent:
onSelectEvent = {event => this.onSelectEvent(event)} //Fires selecting existing event
Then I created a handler for the action:
//Clicking an existing event allows you to remove it
onSelectEvent(pEvent) {
const r = window.confirm("Would you like to remove this event?")
if(r === true){
this.setState((prevState, props) => {
const events = [...prevState.events]
const idx = events.indexOf(pEvent)
events.splice(idx, 1);
return { events };
});
}
}
Hope that helps
Most helpful comment
I managed to do this the other day...
In your Calendar object you need an action assigned to the OnSelectEvent:
onSelectEvent = {event => this.onSelectEvent(event)} //Fires selecting existing eventThen I created a handler for the action:
Hope that helps