Ресурсы кеша ResourceDidAmount - PullRequest
       102

Ресурсы кеша ResourceDidAmount

0 голосов
/ 07 августа 2020

Я использую resourceTimeGridDay и хочу отображать свойство в заголовке в зависимости от дней. resourceLabelContent работает хорошо, но когда я всплываю с resourceLabelDidMount, он не работает, потому что он не загружается, когда я меняю день. Я имею в виду, что были загружены свойства первого дня, и если в другой день был тот же ресурс с другими свойствами, он не изменил его. На картинке вы можете видеть в заголовке и дополнительном свойстве C .R, которое появляется только 6 августа, но во всплывающей подсказке оно не отображается, потому что оно принимает свойства 3 августа

enter image description here

enter image description here

resourceLabelDidMount: function (info) {
    $(info.el).mouseover(function (e) {
        htmlTooltip = _tooltipCalendario.TooltipTitulosQuirofanos(info.resource)
        $("body").append(htmlTooltip);
        $(this).css('z-index', 10000);
        $('.tooltip-detalle').fadeIn('500');
        $('.tooltip-detalle').fadeTo('10', 1.9);
    }).mousemove(function (e) {
        $('.tooltip-detalle').css('top', e.pageY + 10);
        $('.tooltip-detalle').css('left', e.pageX + 20);
    });
    $(info.el).mouseout(function (e) {
        $(this).css('z-index', 8);
        $('.tooltip-detalle').remove();
    })
},
eventContent: function (info) {
    if (info.event.extendedProps.esDiaFestivo) {
        return "";
    }
    if (info.event.extendedProps.procedimiento != "" && 
        info.event.extendedProps.procedimiento != null && 
        info.event.extendedProps.procedimientoLibre != null && 
        info.event.extendedProps.procedimientoLibre != "") {
            var listado = '<div class="fc-event-main-frame"><div class="fc-event-time">' + moment(info.event.startStr).format("HH:mm") + ' - ' + moment(info.event.endStr).format("HH:mm") + '</div><div class="fc-event-title-container"><div class="fc-event-title fc-sticky"> <div><ul class="paddingeventoscaledario"><li> ' + info.event.extendedProps.procedimiento + '</li><li>' + info.event.extendedProps.procedimientoLibre + '</li></ul> </div></div></div><div>'
            return { html: listado }
        }
        if (info.event.extendedProps.motivoBloqueo != "") {
            var listado = '<div class="fc-event-main-frame"><div class="fc-event-time">' + moment(info.event.startStr).format("HH:mm") + ' - ' + moment(info.event.endStr).format("HH:mm") + '</div><div class="fc-event-title-container"><div class="fc-event-title fc-sticky"><span><i class="marginRight5px fas fas fa-user-lock"></i>' + info.event.extendedProps.medicoResponsableAgenda + '</span></div></div><div>'
        }
        return info.event.title
    },
    resourceLabelContent: function (info) {
        if (info.resource.extendedProps.tieneMasDatos) {
            var title = info.resource.title
            var x = 1;
            $(info.resource.extendedProps.profesionales).each(function () {
                title = title + "<br />C.r " + x + ": " + this.NumeroColegiado
                x = x + 1;
            });
            return { html: title }
        }
        return { html: info.resource.title }
}

...