完整日历(当事件限制=真时,angular-ui事件更改背景

时间:2017-02-21 08:32:52

标签: jquery angularjs fullcalendar angular-ui

当我有限制事件时,我不知道如何进行事件背景颜色更改(例如:我想用背景颜色绘制事件,我不想要文本“ +2更多“);

class fc-more是事件的div。

配置:

$scope.uiConfig = {
        calendar: {
            firstDay:1,
            height: 'auto',
            editable: true,

                eventLimit: true,
                 eventLimitText: "",


                            views: {
                                month: {
                                   eventLimit: 1
                                }},

            titleFormat: {
                     month: 'MMMM'
            },
            header: {
                left: 'prev',
                center: 'title',
                right: 'next'
            },
             eventRender:  function (event, element) {
                        element = angular.element('fc-more');
                element.css('background-color', 'yellow');
                debugger;
        if(event.color =="#3985AA")
        {
            element.css('background-color', '#3985AA');
        }
        if(event.color =="#43AF89")
        {
            element.css('background-color', '#43AF89');
        }
        if(event.color =="#FFC900")
        {
            element.css('background-color', '#FFC900');
        }

    },

HTTP Ajax

    $scope.eventSources = [

    ];
    ajax.sendApiRequest({}, "GET", "eventosusuario", false).then(function (response) {
        angular.forEach(response.data, function (evento) {
            evento.start = new Date(evento.fecha);
            evento.allDay = true;
            evento.end = new Date(evento.fecha);
            evento.title = evento.titulo;
            evento.color= "#3985AA";
            evento.textColor="#FFFFFF";
            evento.url="#/app/evento/"+evento.nid;

        })
        $scope.eventSources.push(response.data);

    }, function (error) {
        _showPopUp('error', 'error');
    });  

0 个答案:

没有答案