Skip to main content

filter-events

Applies a predicate that filters events out of every view, or clears it. Filters can be stacked under different tag keys; passing the same tag replaces the previous predicate, and omitting filter clears the entry for that tag.

Usage

type FilterEventsPayload = {
filter?: ((event: any) => boolean) | null;
tag?: string;
};
FieldTypeDescription
filter((event: any) => boolean) | nullPredicate that returns true to keep the event. null or omitted clears the entry.
tagstringIdentifier used to stack filters. Same tag overwrites the previous predicate.

Trigger

api.exec("filter-events", {
tag: "calendars",
filter: e => activeIds.includes(e.calendarId),
});

Clear a single tag:

api.exec("filter-events", { tag: "calendars" });

Observe

api.on("filter-events", p => console.log("filter:", p.tag, p.filter));

Intercept

api.intercept("filter-events", p => p.tag !== "system");

Component handler

<Calendar :onfilterevents="p => console.log('filter:', p.tag, p.filter)" />
  • CalendarPanel — sidebar component that auto-dispatches this action.
  • exec — programmatic dispatcher.
  • Filtering — full guide on stacking filters and predicate patterns.
  • Calendar groups — checkbox-driven group filters.