我正在尝试修改FullCalendar月视图,因此每天的单元格都有一个输入元素。
这是我的代码:
(...)
dayRender: function (date, cell) {
cell.append('<input type="number" style="margin-top: 60px; width: 30%; margin-left: 2px; z-index: 10; pointer-events: all!important">');
}
(...)
到目前为止,该输入正在显示,但它并不关注点击。我该如何着眼它呢?
正如您所看到的,我尝试将输入的指针事件发送给所有人,同时将表指针事件设置为无,但结果是相同的。
答案 0 :(得分:1)
我一直在尝试,它可以处理dayClick事件。因此,当单击日期时,我会手动调整输入。这是代码:
dayClick: function() {
$(this).find("input").focus();
}
也许不是最好的解决方案,但它可行。
答案 1 :(得分:0)
我知道你回答这个问题可能有点太晚了,但是可以通过在日历背景上添加更高的z-index来解决这个问题:
.fc-row .fc-bg {
z-index: 5;
}
我希望对寻找同样问题的人有所帮助。