Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何使用fullcalendar在每天添加ID?_Jquery_Fullcalendar - Fatal编程技术网

Jquery 如何使用fullcalendar在每天添加ID?

Jquery 如何使用fullcalendar在每天添加ID?,jquery,fullcalendar,Jquery,Fullcalendar,嗨,我有这个fullcalendarcode: calendar: function(datos,rut,nombre){ var self = this; $('#calendar').fullCalendar({ height: 500, events: datos, editable: true, header: { left: '',

嗨,我有这个
fullcalendar
code:

calendar: function(datos,rut,nombre){

    var self = this;

    $('#calendar').fullCalendar({

        height: 500,
        events: datos,
        editable: true,

            header: {
                left: '',
                center: 'prev title next',
                right: '',
            },

        eventRender: function (event, element) {
            var self = this;
            element.find('.fc-title').append(" (<strong>"+ event.estado +"</strong>)");
        },

        viewRender: function (view) {

        $('.fc-day-number').prepend("<button type='button' style='margin-right:5px; padding:0; border: none; background: none;' id ='editar_control_id' class='btn btn-default addButton' title='Ver/Editar'><i class='fa fa-eye'></i></button>"); 

        },

    })

    $('#calendar').fullCalendar('removeEvents');
    $('#calendar').fullCalendar('addEventSource', datos);         
    $('#calendar').fullCalendar('rerenderEvents');        
},
所以,我希望每个按钮都有一个像Id一样的日期:

例如:

id='editar\u控制\u 2015-09-04\u id'

这是日历:


我该怎么做?对不起,我说的是英语。

使用dayRender和viewRender

dayRender: function (date, cell) {
    // The cell has a data-date tag with the date we can use vs date.format('YYYY-MM-DD')
    var theDate = $(cell).data('date');
    // Find the day number td for the date
    var fcDaySkel = $("#calendar div.fc-content-skeleton td[data-date='"+theDate+"'].fc-day-number");
    fcDaySkel.prepend("<img src='http://icons.iconarchive.com/icons/glyphish/glyphish/24/12-eye-icon.png' id='editar_control_"+theDate+"_id'/>");
}
dayRender:函数(日期,单元格){
//该单元格有一个数据日期标签,上面有我们可以使用的日期vs date.format('YYYY-MM-DD')
var theDate=$(单元格).data('date');
//查找日期的日数td
var fcDaySkel=$(“#calendar div.fc-content-skeleton td[数据日期='”+日期+“'].fc日数”);
fcDaySkel.prepend(“”);
}

这把小提琴用的是img而不是按钮,但方法应该是一样的

你能帮我吗?
dayRender: function (date, cell) {
    // The cell has a data-date tag with the date we can use vs date.format('YYYY-MM-DD')
    var theDate = $(cell).data('date');
    // Find the day number td for the date
    var fcDaySkel = $("#calendar div.fc-content-skeleton td[data-date='"+theDate+"'].fc-day-number");
    fcDaySkel.prepend("<img src='http://icons.iconarchive.com/icons/glyphish/glyphish/24/12-eye-icon.png' id='editar_control_"+theDate+"_id'/>");
}