You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import {Calendar} from '../../build/calendar.module.js?469544';
// this will store the newly created event
let new_event = null;
const calendar = new Calendar({
appendTo: 'container',
mode: 'list',
modes: {
list: {}
},
listeners: {
beforeEventEdit({eventRecord}) {
new_event = eventRecord;
// here we open our custom editor which will recevie the "new_event" as a prop
// prevent built in editor
return false;
},
}
});
const add_button = document.createElement('button');
add_button.id = 'add-button';
add_button.innerText = 'Add';
const remove_button = document.createElement('button');
remove_button.id = 'remove-button';
remove_button.innerText = 'Remove';
document.querySelector('#container').appendChild(add_button);
document.querySelector('#container').appendChild(remove_button);
document.getElementById('add-button').addEventListener('click', function () {
calendar.createEvent(calendar.date);
});
document.getElementById('remove-button').addEventListener('click', function () {
console.log(new_event);
if (new_event) {
new_event.remove()
new_event = null;
}
});
To reproduce
open the example
paste the code I provided
[Important!]Click on Add button (this creates new event and is displayed on the list)
Click on Remove button (the event stays there, when it should be deleted from the list)
Note: also doesn't work with eventStore.remove(record)
The text was updated successfully, but these errors were encountered:
matsbryntse
added
resolved
Fixed but not yet released (available in the nightly builds)
and removed
resolved
Fixed but not yet released (available in the nightly builds)
labels
Aug 2, 2023
Forum post
I am using the Calendar component in List mode view.
We create events using an external button/editor.
If the new event is not going to be saved, we call the "remove" method on the event object. But this doesn't remove the event from the list.
Note: Try adding multiple events one by another and then click remove. In this case works
You can test it by going to below example and paste the code below in the editor
click on add button
click on remove button (I expect the event to be removed from the list)
https://bryntum.com/products/calendar/examples/listview/
To reproduce
Note: also doesn't work with
eventStore.remove(record)
The text was updated successfully, but these errors were encountered: