【问题标题】:Fullcalendar add custom button to each dayFullcalendar每天添加自定义按钮
【发布时间】:2020-05-06 10:25:15
【问题描述】:

如何在 fullCalendar 中为每一天添加自定义按钮?

【问题讨论】:

    标签: javascript html fullcalendar fullcalendar-4


    【解决方案1】:

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

    例如这是一个超级简单的例子:

    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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-16
    • 2011-06-09
    • 2018-01-31
    相关资源
    最近更新 更多