Our pure JavaScript Scheduler component


Post by jbrazier »

Hi,

We're currently using the layoutFn event to render the layout of events in resource rows which is working great.

The issue we have is that when a resource row has no events then the items array passed in to the layoutFn event is empty - the problem for us is that we need to identify the resource row being rendered and its index relative to other resource rows to set its height (we don't want a standard height for all empty resource rows).

But unfortunately without any items we can't identify the resource row being rendered.

Is there a way we can find out which resource row is being rendered from within layoutFn when the items array is empty?

Thanks,

Jason


Post by Animal »

We should pass the resource too. Here is a ticket: https://github.com/bryntum/support/issues/6504


Post by jbrazier »

Ah that would be awesome, thank you.

Jason


Post by jbrazier »

oh hang on, so that event already receives the resource parameter.

I just added it in and it is populated with the resource being rendered - which is exactly what I need.

eventLayout: {
    layoutFn: (
      items: Array<{
        eventRecord: JigsawEvent;
        top: number;
        height: number;
        row: Row;
      }>,
      resource: ResourceModel
    ): number => {

Thanks,

Jason


Post by Animal »

You are using SchedulerPro?


Post by jbrazier »

Yeah :thumbsup: - I was going off the documentation and that doesn't show resource as a parameter for layoutFn


Post Reply