Topic: How to get calendar event id when clicking on event?
QuretecDev priority asked 2 years ago
Expected behavior
Using calendar as read-only. Want to navigate user to custom event page. Get custom event id when clicking on event.
Actual behavior
Unable to link to id.
Resources (screenshots, code snippets etc.)
https://mdbootstrap.com/support/standard/how-to-add-click-event-to-calendar/ specifies how to add on click event.
document.getElementsByClassName('event').forEach((event) => { event.addEventListener('click', () => { console.log('click'); // event.id does not work // how to get the custom attribute id? }); });
https://mdbootstrap.com/docs/standard/plugins/calendar/#section-custom-attributes specifies assigning custom id to event.
Kamila Pieńkowska staff answered 2 years ago
I've prepared snippet to demonstrate that: https://mdbootstrap.com/snippets/standard/kpienkowska/4393344
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 4.3.0
- Device: desktop
- Browser: Firefox
- OS: Windows
- Provided sample code: No
- Provided link: Yes