DayPilot.Scheduler.events.find

Declaration

Using event id as a parameter:

DayPilot.Scheduler.events.find(id);

Using custom find function as a parameter:

DayPilot.Scheduler.events.find(f);

Parameters

  • id (string | number) - id of the event to be found 
  • f (function) - find function that returns true if the search condition is met

Find function syntax:

function f(data) {}

Find function parameters:

Returns

DayPilot.Event object or null. If there are more events with the same id, it returns the first one.

Example

Case insensitive search using event text:

var query = "my text";
var e = dp.events.find(function(e) {
  var match = e.text().toUpperCase().indexOf(query.toUpperCase()) > -1;
return match; });