The onEventFilter event handler fires for each event in the JavaScript Scheduler to determine the effect of the filter applied using events.filter().
Declaration
DayPilot.Scheduler.onEventFilter(args)Parameters
args.e- current event (DayPilot.Event)args.filterParam(object) - custom filter object supplied by DayPilot.Scheduler.events.filter()args.visible(boolean) - determines whether the event should remain visible; the default value istrue
Notes
By default, all events remain visible. Use this event handler to implement custom filter rules by changing args.visible for the current event.
Examples
JavaScript
const dp = new DayPilot.Scheduler("dp", {
onEventFilter: (args) => {
if (args.filterParam && args.filterParam.hide) {
args.visible = false;
}
},
// ...
});
dp.init();
dp.events.filter({ hide: true });Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>config: DayPilot.SchedulerConfig = {
onEventFilter: (args) => {
if (args.filterParam && args.filterParam.hide) {
args.visible = false;
}
},
// ...
};React
<DayPilotScheduler
onEventFilter={onEventFilter}
{/* ... */}
/>const onEventFilter = (args) => {
if (args.filterParam && args.filterParam.hide) {
args.visible = false;
}
};Vue
<DayPilotScheduler
@eventFilter="onEventFilter"
<!-- ... -->
/>const onEventFilter = (args) => {
if (args.filterParam && args.filterParam.hide) {
args.visible = false;
}
};See Also
Event Filtering [doc.daypilot.org]
DayPilot.Scheduler.events.filter
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot