Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML in title string of fullcalendar jquery plugin

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, for example bold text, colors, or small images.

The solution with another plugin (for example qTip, like in the examples) will not work the right way for me. Is there anyway to format the title text?

like image 968
Chichi Avatar asked Aug 04 '10 21:08

Chichi


4 Answers

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 .

like image 144
Giancarlo Gomez Avatar answered Nov 08 '22 22:11

Giancarlo Gomez


Because the CSS class has changed, this is the correct answer:

eventRender: function (event, element) {
    element.find('.fc-title').html(event.title);
}
like image 28
Pascal Klein Avatar answered Nov 08 '22 22:11

Pascal Klein


To easily have all html in event titles show I used this, makes it very easy.

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

Which was found here http://code.google.com/p/fullcalendar/issues/detail?id=152

like image 14
jhanifen Avatar answered Nov 08 '22 22:11

jhanifen


I have done like this, Check the link Link

eventRender: function (event, element) {
    element.find('.fc-title').html(event.title);/*For Month,Day and Week Views*/
    element.find('.fc-list-item-title').html(event.title);/*For List view*/
}
like image 3
Ashi Avatar answered Nov 08 '22 23:11

Ashi