Fullcalendar每天添加自定义按钮 [英] Fullcalendar add custom button to each day

查看:209
本文介绍了Fullcalendar每天添加自定义按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在全日历中每天添加自定义按钮?

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

推荐答案

为此,最好的解决方案可能是 dayRender回调,它允许您在每天将其绘制在日历上之前,将额外的HTML添加到该单元格中.

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";
}

实时演示(包括已处理的单击事件): https://codepen.io/ADyson82/pen/oNjExGx

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

这篇关于Fullcalendar每天添加自定义按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆