Our pure JavaScript Scheduler component


Post by Aniket »

Team,

I am using the dependencies feature to plot my dependencies between events.

In addition to plotting the dependencies, I want to filter out events only that have dependencies.

I.E, When I show the dependencies, I want to show only the events that have dependencies, rest should get filtered out, just like in the filtering demo.

Any idea how can I achieve this functionality.


Post by Aniket »

Any thoughts?


Post by mats »

Sure, just use basic Store filtering.

https://bryntum.com/docs/scheduler/#Core/data/mixin/StoreFilter

scheduler.eventStore.filter(record => scheduler.dependencyStore.getEventDependencies(record).length > 0);

Post by Aniket »

Yes Mats, This way does help me to filter out the events on a click of btton.

Anyway I can remove this filter so that I get the original view back?


Post by Aniket »

Mats, removeFilter method from the docs was helpfull in removing this filter!!!

Thanks!!


Post by saki »

Yes, there is https://bryntum.com/docs/scheduler/#Core/data/mixin/StoreFilter#function-removeFilter method that can be used for that. However, the method needs filter id as the first argument so you need to slightly modify the way you create the filter. The following should work:

scheduler.eventStore.filter({
    id : 'withDependencies',
    filterBy : record => scheduler.dependencyStore.getEventDependencies(record).length > 0
});

// to remove
scheduler.eventStore.removeFilter('withDependencies');

Post Reply