new Events(oCalendar)
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 |
---|---|---|
oCalendar |
Calendar | Indicates an object of Calendar type that owns the collection |
- Since:
- 1.5
Methods
Add(oEventOptsopt) → {Event}
The Add() method creates and adds a new event into the control.
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
oCalendar.Events.Add("#1/1/2001#").Shape = "red", colorizes Jan 1st, 2001 on red
oCalendar.Events.Add({date: "#1/1/2001#", shape: "red"}), adds a new event on Jan 1st, 2001
Add
Clear()
The Clear() method removes all events of the control and inits the control's scroll-bars
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:
oCalendar.Event.GetCount(), counts the events within the control
oCalendar.Event.Count, counts the events within the control
where oCalendar is an object of Calendar 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:
|
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
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:
|
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