Our pure JavaScript Scheduler component


Post by wylie »

Hi Team,
Could I get some advice on the best way to tackle this.

Outcome I would like:

  • On selection of a list item, the event store is filtered by that value

  • For any resources, that now have zero events displayed in the current time range, hide the resource

Problem this solves:

  • We are using "resource" as a project

  • With events being project phases

  • I want to filter down to just the events (project phases) that I am involved in

  • this will result in a large number of resources (hundreds) that now have no events, and allot of scrolling and white space to see just the resources I am interested in

Question:

  • currently I call Filter on the EventStore, which works great

  • what should I look at to calculate if there are any resources that have no events displayed in the current time range, are there any helpers for this?

  • is there a property that tracks the count of 'visible' events for a resource?


Post by mats »

what should I look at to calculate if there are any resources that have no events displayed in the current time range, are there any helpers for this?

Some filtering pseudo code:

scheduler.resourceStore.filter(resource => resource.events.some(event => event.startDate >= scheduler.startDate && event.endDate <= scheduler.endDate))

Recommended to use https://bryntum.com/docs/scheduler/api/Core/helper/DateHelper#function-intersectSpans-static

is there a property that tracks the count of 'visible' events for a resource?

No, but you could implement it easily on the Scheduler given the about example


Post by wylie »

Thankyou Mats - i implemented something based on your concept and it works super well. Very slick!


Post Reply