Я использовал ответ Gjermund Dahl выше, пока не сделал некоторые изменения в своем календаре. С помощью этого метода я могу сделать форматирование разным для разных представлений. Когда календарь использует списки и временные шкалы, удаление класса заголовка в общем действии при рендеринге приводит к различным результатам в разных представлениях.
eventRender: function(event, element) {
// explore the element object
// console.log(element);
// edit list view titles
// during the render, check for the list class to be in the element
// if there is a fc-list-class then we are going to make our changes accordingly
if( element[0].className === 'fc-list-item' ){
// create your new name
var x = '<strong>' + event.title + ' ' + model + '</strong><br/>' + cust;
// create array to be added to element
var update = { innerHTML: x };
// replace element with update value in the right place
$.extend( true, element[0].childNodes[2], update );
}
// edit timeline view titles
// during the render, check for the timeline class to be in the element
// if there is a fc-timeline-event then we are going to make our changes accordingly
if( element[0].className.indexOf( 'fc-timeline-event' ) === 0 ) {
var x = '<span class="fc-title">' + '<strong>'
+ customer + '</strong><br/>'+ new + ' ' + make + ' ' + model + '</span>';
// create array to be added to element
var update = { innerHTML: x };
// replace element with update value in the right place
$.extend( true, element[0].childNodes[0].firstChild, update );
}
}
Обратите внимание на различные места, которые добавлены в двух видах. Вам нужно будет исследовать свой элемент объекта, чтобы проверить, где вы хотите новый контент. Вы также можете выбрать, где сделать это изменение с большим контролем. Измените innerHTML, или innerText, или что хотите ваше сердце.