将数据添加到每天的单元格中,在fullCalendar中 [英] adding data into each day's cell, in fullCalendar
问题描述
我有额外的数据(在我的情况下是一个数字),它是通过javascript函数获得的 - 我想在每天的单元格中显示。
so例如 - 如果日数在右上角,我希望显示在左上角 - 每天自动显示。
我看到的是 类似这样的失败(显然是): 感谢! 对于后代....这是可以做到的: I have additional data (in my case its a number) which is obtained via a javascript function - which i would like to display within each day's cell. so for example - if the day number is in the top right corner, i would like this displayed in the top left - automatically for each day. I see there is the something like this fails (obviously..): thanks! for future generations.... this is what can be done:
这篇关于将数据添加到每天的单元格中,在fullCalendar中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! dayRender
,看起来确切我需要的。但我不确定添加文本的语法以及定义位置。
... ////在$('#calendar')内。fullCalendar({
dayRender:function(date, cell){
var cellYear = date.getFullYear();
var cellMonth = date.getMonth()+ 1;
var cellDay = date.getDate();
cell.html(ReturnCellNumber(cellDay,cellMonth,cellYear));
},
cell.prepend('< span class =selector>'+ ReturnCellNumber(cellDay,cellMonth,cellYear)+'< span>');
dayRender
method, which seems exactly what i need. but i am not sure of the syntax to add the text, and define the location.... //// within $('#calendar').fullCalendar({
dayRender: function (date, cell) {
var cellYear = date.getFullYear();
var cellMonth = date.getMonth() + 1;
var cellDay = date.getDate();
cell.html(ReturnCellNumber(cellDay,cellMonth,cellYear));
},
cell.prepend('<span class="selector">' + ReturnCellNumber(cellDay,cellMonth,cellYear) + '</span>');