I have to add a new control in EventCalendar Editor. I have top open an existing page in a popup when I click on the control.
Hello,
You can add a custom button to the editor like this:
eventCalendarInstance.api.on('edit-event', (obj) => {
const detailsButton = document.createElement('button');
detailsButton.textContent = 'Details';
detailsButton.classList.add('details-button');
setTimeout(() => {
const formContainer = document.querySelector('.wx-event-calendar-editor-form');
if (formContainer) {
formContainer.appendChild(detailsButton);
detailsButton.addEventListener('click', () => {
console.log('Button clicked!');
});
} else {
console.error('Form container not found.');
}
}, 0);
});
Styles:
.details-button {
display: block;
width: 100%;
margin-top: 20px;
padding: 10px;
background-color: #007bff;
color: #fff;
border: none;
cursor: pointer;
text-align: center;
font-size: 16px;
border-radius: 4px;
}
.details-button:hover {
background-color: #0056b3;
}
Please see an example: DHTMLX Snippet Tool