将数据添加到每天的单元格中,在fullCalendar中 [英] adding data into each day's cell, in fullCalendar

查看:704
本文介绍了将数据添加到每天的单元格中,在fullCalendar中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有额外的数据(在我的情况下是一个数字),它是通过javascript函数获得的 - 我想在每天的单元格中显示。

so例如 - 如果日数在右上角,我希望显示在左上角 - 每天自动显示。



我看到的是 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>'); 


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 dayRender method, which seems exactly what i need. but i am not sure of the syntax to add the text, and define the location.

something like this fails (obviously..):

... //// 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));

        },

thanks!

解决方案

for future generations.... this is what can be done:

cell.prepend('<span class="selector">' + ReturnCellNumber(cellDay,cellMonth,cellYear) + '</span>');

这篇关于将数据添加到每天的单元格中,在fullCalendar中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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