HTML in title string of fullcalendar jquery plugin

前端 未结 6 1922
离开以前
离开以前 2021-01-31 08:18

I think the fullcalendar jquery-plugin is a really great solution. However, I noticed the plugin escapes (htmlEscape) the title. But I need to format some strings in the title,

6条回答
  •  深忆病人
    2021-01-31 08:57

    I did this instead as the other views use the same class but not spans and I forced in the title from the event rather than making an additional request for the text.

    eventRender: function (event, element) {
        element.find('.fc-event-title').html(event.title);
    }
    

    In v2, you may use:

    element.find('span.fc-title').html(element.find('span.fc-title').text());
    

    The span class is fc-title as opposed to fc-event-title.

    Credit to j00lz for the comment confirming the change .

提交回复
热议问题