Events class (Schedule)

Events(oSchedule)

new Events(oSchedule)

The Events object holds a collection of Event type (event of the control). Use the Events/GetEvents() method to access the control's events collection.
Parameters:
Name Type Description
oSchedule Schedule Indicates an object of Schedule type that owns the collection
Events

Methods

Add(oEventOptsopt) → {Event}

The Add() method creates and adds a new event into the control. The Add() method supports one (options) or two parameters (start and end margins of the event), as shown in the example.
Parameters:
Name Type Attributes Description
oEventOpts object <optional>
Specifies the options to create the new event as an object of EventOptions type
Returns:
Returns the newly created event, as an object of Event type
Type
Event
Example
oSchedule.Events.Add("#1/1/2001 10:00#", "#1/1/2001 13:00#"), (two-parameters) adds a new event from 10:00 AM to 1:00 PM on Jan 1st, 2001
 oSchedule.Events.Add({start: "#1/1/2001 10:00#", start: "#1/1/2001 13:00#"}), (one parameter) adds a new event from 10:00 AM to 1:00 PM on Jan 1st, 2001
 oSchedule.EnsurseVisibleClient(oSchedule.Event.Add("#1/1/2001 10:00#", "#1/1/2001 13:00#")), adds a new event and scrolls the control to ensure that the newly event fits the control's client area
Add

Clear()

The Clear() method removes all events of the control and inits the control's scroll-bars
Clear

GetCount() → {number}

The GetCount() method returns the number of events within the collection
Returns:
Returns the number of events within the collection
Type
number
Example
The following statements are equivalents:

 oSchedule.Event.GetCount(), counts the events within the control
 oSchedule.Event.Count, counts the events within the control

where oSchedule is an object of Schedule type
GetCount

Item(id) → {null|Event}

The Item() method gets the event giving its index, identifier/key or reference. The Event(id) method returns the event based on its index or identifier/key (equivalent of this method)
Parameters:
Name Type Description
id any The id parameter could be any of the following:
  • id {number}, indicates a numeric value that defines the index of the event to request
  • id {string}, specifies a string expression that defines the identifier/key of the event to request
  • id {Event}, specifies the object reference to the event to request for
Returns:
Returns null if the event is not found, or an object of Event type, if the events collection contains the giving id.
Type
null | Event
Item

Remove(id)

The Remove() method removes an event from the collection.
Parameters:
Name Type Description
id any The id parameter could be any of the following:
  • id {number}, indicates a numeric value that defines the index of the event to request
  • id {string}, specifies a string expression that defines the identifier/key of the event to request
  • id {Event}, specifies the object reference to the event to request for
Remove

RemoveRange(range) → {number}

The RemoveRange() method removes multiple-events at once
Parameters:
Name Type Description
range any Indicates an event, an array [{Event}], or an exontrol.Arr([{Event}])
Returns:
Returns the number of events being deleted
Type
number
RemoveRange