Hi all:I’m having some issues integrating fullcalendar with a modal edit dialog.I have a custom file (including common files) showing a calendar (fullcalendar.io) and it shows a tooltip when you go over the events. I had to add the popper and tooltip references to get it work.
When I click on a event, I show a modal edit page, with some “selects”. My problem is, when I click in the dropdowns, or click in a calendar icon, they don’t open, and I get an error in console: “Uncaught TypeError: Popper.createPopper is not a function”
I’ve seen the dropdowns use popper too, so must some kind of incompatiblity with my includes
I’ve tried removing the popper and tooltip lines (I think with the project files, they should work, but I get an error of tooltip not defined if I don’t add them)Some ideas?Thanks¡¡
Thanks (as always) for your answer. I assumed it was something like this but I didn’t know how to wait for it.
I’ve been trying to write your code in several places, but with no success (probably something with DOMContentLoaded that seems it waits too for something.
<script>
'Here I've tried
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
InitialView: 'dayGridWeek',
eventDidMount: function(info) {
'Here I've tried
var tooltip = new Tooltip(info.el, {
title: info.event.extendedProps.description,
placement: 'top',
trigger: 'hover',
container: 'body'
});
},
});
});
</script>
By the way, if I add too the fullcalendar with composer, how do I load instead of:
You should run your code after Popper is loaded, e.g.
loadjs.ready(“popper”, () => {
// your code
});
>
See examples for Page_Head [server event](https://phpmaker.dev/docs/#/customscripts.html?id=global-all-pages) for more information. Since it is a Custom File, you may put the script in your file content directly (inside <script> tag of course).