Hi:
I'm trying to add customButton as indicated in fullcalendar docs. (v2024)
var calendar = new Calendar(calendarEl, {
customButtons: {
myCustomButton: {
text: 'custom!',
click: function() {
alert('clicked the custom button!');
}
}
},
headerToolbar: {
left: 'prev,next today myCustomButton',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
}
});
I've tried in Page_Render:
$this->CalendarOptions->set("headerToolbar.left", "prev next today myCustomButton");
$this->CalendarOptions->set("customButtons", ["myCustomButton",["text" => "MyText"]]);
and in Page_Load
$this->CalendarOptions->import([
"initialView" => "dayGridWeek", // Set initial view to Year
"weekNumbers" => "true",
"businessHours" => "true",
"firstDay" => "1", //primer día, lunes
"customButtons"=>["myCustomButton",["text" => "MyText"]]
]);
With no results. I've tried several ways of writing the arrays... I just get a small button without text inside.
I don't know how to do just the button text, not to mention the part of the function.
Thanks