question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eventAfterRenderPopover and eventAfterAllRenderPopover

See original GitHub issue

Hi all, i don’t know if it is just possible, but i have modified source code of fullcalendar to have two function handlers:

  1. after each event is rendered in the “popover”
  2. 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:closed
  • Created 8 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
danielemamscommented, Dec 22, 2015

i have just added a jsbin here: http://jsbin.com/heyafuquta/edit?html,js,output

0reactions
arshawcommented, Jun 24, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found