Skip to content Skip to sidebar Skip to footer

Display Resource Name In Event

I'm trying out the new Scheduler add-on for FullCalendar. I've got it all working great, but I hoped there'd be a property I could add to an Event object so that it would display t

Solution 1:

Easy enough to do with the eventRender callback.

eventRender:function( event, element, view ) {
    $(element).find(".fc-content").append("<div>"+event.resourceId+"</div>");
}

JSFiddle

If you want, say the title of the resource instead of the ID, use the getResourceById method too.

eventRender:function( event, element, view ) {
    var resource = $("#calendar").fullCalendar("getResourceById","1");
    $(element).find(".fc-content").append("<div>"+resource.title+"</div>");
}

JSFiddle


Post a Comment for "Display Resource Name In Event"