Our powerful JS Calendar component


Post by jason@in-vista.nl »

Hi all,

I am trying to set up a calendar with resource day view. I want to overwrite the default HTML that is used to display the contents of the event records. I stumbled upon the configuration function eventRendererhttps://bryntum.com/products/calendar/docs/api/Calendar/widget/mixin/CalendarMixin#config-eventRenderer. I tried to set it up for my day resource view in my Calendar's modes, but the function is never called. I tried it with a simple console.log, but without any results.

I had also tried to set up the eventRenderer function for other modes (month, week, year) and all of these work. It seems like it does not work for day resource views.

Here is my configuration for my modes:

modes: {
    day: null,
    year: null,
    agenda: null,
    dayResources: {
        type: 'resource',
        title: 'Dag',
        resourceWidth: '20em',
        viewGap: 0,
        hideNonWorkingDays: false,
        view: {
            type: 'dayview'
        },
        meta: resource => resource.title,
        eventRenderer({ eventRecord, renderData }) {
            console.log(eventRecord, renderData);
        }
    },
    week: true,
    month: true
}

Post by ghulam.ghous »

Seems like a bug, I have opened a ticket here: https://github.com/bryntum/support/issues/11259 to fix it.


Post by Animal »

Kinda borderline whether this is a bug. We can enhance it to pass down eventRenderer into the actual view.

But you can make it work by putting it on the view. The ResourceView is just a container for multiple instances of whatever view you specify - one for each resource.

So to configure those views, it's the view property you need.


Post by jason@in-vista.nl »

Hey Animal,

I indeed put it under the wrong object. The eventRenderer event has to be put under a view instance, not the "dayResources" object in my case. Thanks!


Post Reply