Mina
Mina

Reputation: 527

triggering a function after Fullcalendar eventAfterAllRender

I have my fullcalendar script in a separate file and it already has "eventAfterAllRender" set.

Now in another js file, I try to trigger clicking on a button on the page on the load, where there is a fullcalendat on the same page too.

So, when i run the code, on the load, the events are not rendered. what i want is to have something like

$("calendar").fullCalendar({
    eventAfterAllRender: function() {$("#button").click();}
})

but what happens is that it overwrites the already existing default function in eventAfterAllRender for my fullCalendar.

What I want is to extend eventAfterAllRender option in my fullcalendar and $("#button).click() after the default function in eventAfterAllRender is executed.

How is it possible? :)

Upvotes: 4

Views: 10967

Answers (1)

Jan Janoušek
Jan Janoušek

Reputation: 51

In your code you have two mistakes.

$("calendar").fullCalendar({
    eventAfterAllRender: function(){
        $("#button").click();
    }
});

Upvotes: 5

Related Questions