eventAfterRenderPopover and eventAfterAllRenderPopover
See original GitHub issueHi all, i don’t know if it is just possible, but i have modified source code of fullcalendar to have two function handlers:
- after each event is rendered in the “popover”
- after all events are rendered in the “popover”.
here code: http://pastebin.com/mPdG607e
in line: 5691, after:
DayGrid.mixin({
put:
// Signals that all events have been rendered in Popover
triggerEventRenderPopover: function(seg) {
var _this = this;
jQuery(seg).each(function() {
var seg = this;
_this.view.trigger('eventAfterRenderPopover', seg.event, seg.event, seg.el);
});
_this.view.trigger('eventAfterAllRenderPopover');
},
and here:
// Reveals the popover that displays all events within a cell
showSegPopover: function(row, col, moreLink, segs) {
put at the end of the function:
this.segPopover = new Popover(options);
this.segPopover.show();
this.triggerEventRenderPopover(segs);
Now in your code you can use:
$(document).ready(function() {
$('#calendar').fullCalendar({
events: [
{
title: 'Conference',
start: '2015-12-11',
end: '2015-12-13'
},
{
title: 'Meeting',
start: '2015-12-12T10:30:00',
end: '2015-12-12T12:30:00'
},
{
title: 'Lunch',
start: '2015-12-12T12:00:00'
},
{
title: 'Meeting',
start: '2015-12-12T14:30:00'
},
{
title: 'Happy Hour',
start: '2015-12-12T17:30:00'
},
{
title: 'Dinner',
start: '2015-12-12T20:00:00'
}
],
eventLimit: true,
eventAfterRender: function(event, element, view) {
element.attr("title", "i_am_an_normal_event!");
},
eventAfterAllRender: function(view) {
console.log("eventAfterAllRender");
},
eventAfterRenderPopover: function(event, element, view) {
element.attr("title", "i_am_an_event_only_in_the_popover!");
},
eventAfterAllRenderPopover: function(view) {
console.log("eventAfterAllRenderPopover");
}
});
});
I hope this will help someone else.
Daniele.
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
FullCalendar After eventLimitClick - Stack Overflow
My solution was to watch for .fc-popovers inserted into the .fc-view and ...
Read more >eventRender - Docs v3 - FullCalendar
event is the Event Object that is attempting to be rendered. element is a newly created jQuery element that will be used for...
Read more >How to Render a React Component Inside a Bootstrap Popover
popover ({ 4 html: true, 5 content: `<div>Hello</div>` 6}); 7// .. js. You can see the popover in action when you click on...
Read more >How To Format The Date Used In The Popover Widget Title Of ...
eventAfterAllRender. Triggered after all events have finished rendering. Docs Event Popover. When not all events will fit in a given day you can...
Read more >Source of CHANGELOG.md - scheduler - Bitbucket
The viewRender callback might now be fired AFTER events have been ... eventDestroy not called when removing the popover (#3416, #3419) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i have just added a jsbin here: http://jsbin.com/heyafuquta/edit?html,js,output
as of v5 (and similarly in v4), all events, even ones in the popover, are run through the event render hooks
If you want information from within one of those hooks about whether an event lives in the popover, you’d want an extra argument in one of those hooks (like
arg.isWithinPopover
). Please open another issue for that if you need it.