Fullcalendar add custom button to each day

限于喜欢 提交于 2021-01-28 11:53:47

问题


How can I add custom buttons for each day in the fullCalendar?


回答1:


For that your best solution is probably the dayRender callback which allows you to add extra HTML into the cell of each day before it is drawn on the calendar.

e.g. here's a super-simple example:

dayRender: function(info)
{
  info.el.innerHTML += "<button class='dayButton' data-date='" + info.date + "'>Click me</button>";
  info.el.style.padding = "20px 0 0 10px";
}

Live demo (including handled click event): https://codepen.io/ADyson82/pen/oNjExGx



来源:https://stackoverflow.com/questions/61632845/fullcalendar-add-custom-button-to-each-day

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!