vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views
https://vkurko.github.io/calendar/
MIT License
964 stars 82 forks source link

eventContent does not render html #286

Closed Akhmami closed 5 days ago

Akhmami commented 1 week ago

I followed the tutorial here but the html is not rendered, here are the screenshots:

image
//... more option property
eventContent: function(info) {
                        return info.event.display === 'auto' ?
                            '<div class="ec-event-time">' + info.timeText + '</div>' +
                            '<div class="ec-event-title">' + info.event.title + '</div>' +
                            '<div x-data="{ isOpen: false }" x-on:mouseover="isOpen = true" x-on:mouseleave="isOpen = false">' +
                            '<div x-show="isOpen" class="absolute z-10 top-0 right-0 p-2 mt-2 bg-white rounded-md shadow-sm">' +
                            '<p class="text-sm text-gray-700">Popover content here</p>' +
                            '</div>' +
                            '</div>' : '';
                    },
devto11pm commented 1 week ago

I think you should add HTML content to object with html key like this

return { html: '<div>your content sample</div>' };

vkurko commented 6 days ago

return { html: '<div>your content sample</div>' };

Thank you. Since v0.14.0 this is the correct form of providing html value