new Event(oEvents)
The Event object holds the event of the control. The Event(id) method returns the event based on its index or identifier/key.
Every option of the EventOptions type has associated a property of the Event object. For instance, the option:
cursor {string}, defines the mouse-cursor for the eventis associated with the property:
Cursor {string}, defines the mouse-cursor for the eventwhich means that the following statements are equivalent:
oEvent.Options = {cursor: "pointer"}where oEvent is an object of Event type
oEvent.SetOptions({cursor: "pointer"})
oEvent.Cursor = "pointer"
oEvent.SetCursor("pointer")
Parameters:
Name | Type | Description |
---|---|---|
oEvents |
Event | Indicates an object of Events type that's the owner collection of this event |
- Since:
- 1.5
Methods
GetCursor() → {string}
The GetCursor() method defines the mouse cursor for the event.
Returns:
Returns the mouse-cursor for the event.
- Type
- string
GetDate() → {any}
The GetDate() method defines the date of the event
Returns:
Returns the date of the event
- Type
- any
GetIndex() → {any}
The GetIndex() method retrieves the event's index.
Returns:
Returns the event's index (0-based)
- Type
- any
Example
The following statements are equivalents:
oEvent.GetIndex(), retrieves the event's index
oEvent.Index, retrieves the event's index
where oEvent is an object of Event type
GetIndex
GetKey() → {string}
The GetKey() method returns the event's key.
Returns:
Returns the event's key
- Type
- string
GetOptions() → {object}
The GetOptions() method returns the event's options at once
Returns:
Returns an object of EventOptions type
- Type
- object
Example
The following statements are equivalents:
oEvent.GetOptions(), returns the event's options
oEvent.Options, returns the event's options
where oEvent is an object of Event type
GetOptions
GetRepetitive() → {string}
The GetRepetitive() method defines the expression to define the repetitive-event
Returns:
Returns the expression to define the repetitive-event
- Type
- string
GetSelectable() → {boolean}
The GetSelectable() method determines whether the user can select the date
Returns:
Returns true if the user can select the date
- Type
- boolean
GetShape() → {any}
The GetShape() method defines the shape for the event.
Returns:
Returns the shape for the event, as one of the following:
- null, no custom-shape is applied on the object (default-shape may be applied instead)
- the shape's name within the exontrol.Shape.Calendar or exontrol.Shape namespace
- a CSS color
- a JSON string-representation of an object of exontrol.Def.Shape type, for the event
- an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
- Type
- any
GetToolTip() → {any}
The GetToolTip() method defines event's predefined tooltip
Returns:
Returns the event's predefined tooltip
- Type
- any
GetUserData() → {any}
The GetUserData() method gets the extra-data associated with the event
Returns:
Returns the extra-data associated with the event
- Type
- any
Remove()
The Remove() method removes the event from the events collection
SetCursor(value)
The SetCursor() method changes the mouse cursor for the event.
Parameters:
Name | Type | Description |
---|---|---|
value |
any | A string expression that defines the mouse cursor for the event. |
Example
"pointer" {string}, The cursor is a pointer that indicates a link (typically an image of a pointing hand)
SetCursor
SetDate(value)
The SetDate() method sets the date of the event
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Specifies the date of the event, as explained: {null} or {undefined}, indicates the current date and time (equivalent of Date.Now()) {number}, indicates the Jan 1st of the year, such as "Jan 1st 2001" for 2001 {string}, defines the date in string-format as "#MM/DD/YYYY[ HH:mm:ss]#", such as "#10/10/2011 14:48#" or string-format as "YYYY-MM-DDTHH:mm:ss.sssZ" (ISO 8601), such as "2011-10-10" (date-only format), "2011-10-10T14:48:00" (local date-time format), "2011-10-10T14:48:00Z" (UTC date-time format), or "2011-10-10T14:48:00.000+09:00" (date-time format with milliseconds and time zone offset) {Date}, indicates a javascript Date to be copied, such as "Wed, 25 Mar 2015 15:00:00 GMT" for new Date("2015-03-25T15:00:00Z") |
Example
null {null}, is equivalent of Date.Now()
2001 {number}, is equivalent of Mon, 01 Jan 2001 00:00:00 GMT
"#12/31/1971 13:00#" {string}, is equivalent of Fri, 31 Dec 1971 13:00:00 GMT
new Date("2015-03-25T15:00:00Z"), is equivalent of Wed, 25 Mar 2015 15:00:00 GMT
SetDate
SetKey(value)
The SetKey() method assigns a new key to the event
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Specifies a new key to be assigned to the event |
Example
"logo" {string}, defines the event with the giving key (logo). You can use the oCalendar.Event("logo") method to request the event giving its key.
SetKey
SetOptions(oOptions)
The SetOptions() method changes the event's options (visibility, caption, ...) at once
Parameters:
Name | Type | Description |
---|---|---|
oOptions |
object | Specifies an object of EventOptions type that holds information about the event, such as caption, image and so on. If the oOptions parameter is not-of object type it indicates the event's caption instead |
Example
oCalendar.Event(0).Options = {shape: "red", height: 32}, changes the event's height and background
oCalendar.Event(0).SetOptions({shape: "red", height: 32}), changes the event's height and background
SetOptions
SetRepetitive(value)
The SetRepetitive() method sets the expression to define the repetitive-event
Parameters:
Example
Value format samples:
"" {string} or null {null}, the event is not repetitive (no effect)
"0" {string}, no occurrence
"1" {string}, the event occurs every day
"weekday(value) = 1" {string}, the event occurs every Monday
"weekday(value) in (1,2) and month(value) = 6", the event occurs every Monday and Tuesday, on June only
"value in (#6/8/2012#,#6/11/2012#,#6/20/2012#)", the event occurs on 6/8/2012, 6/11/2012 and 6/20/2012
"value >= #6/1/2012# and ( (value - #6/1/2012#)/86400000 mod 5 = 0)", the event starts on 6/1/2012, and shows up every 5 days
ICalendar format samples (requires "exontrol.icalendar.js"):
"FREQ=DAILY", the event occurs daily
"FREQ=MONTHLY", the event occurs monthly
"FREQ=WEEKLY;BYDAY=MO,FR", the event occurs weekly every Monday and Friday
SetRepetitive
SetSelectable(value)
The SetSelectable() method specifies whether the user can select the date
Parameters:
Name | Type | Description |
---|---|---|
value |
boolean | Indicates a boolean expression that specifies whether the user can select the date |
Example
false {boolean}, the user can not select the date
true {boolean}, the user can select the date
SetSelectable
SetShape(value)
The SetShape() method changes the shape for the event.
Parameters:
Name | Type | Description |
---|---|---|
value |
any | The value could be any of the following:
|
Example
null {null}, no custom shape is applied (default object's shape may be applied)
"" {string}, no custom shape is applied (no default object's shape is be applied)
"red" {string}, fills the object's background in red (CSS color)
'{"fillColor": "red"}' or '{"normal":{"fillColor": "red"}}' {string}, fills the object's background in red (JSON-representation of an object of exontrol.Def.Shape type)
"xxx" {string}, indicates that exontrol.Shapes.Calendar.xxx or exontrol.Shapes.xxx is applied on the object's background. If the xxx field is missing, no custom shape is applied (no default object's shape is be applied)
exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace
SetShape
SetToolTip(value)
The SetToolTip() method sets the event's predefined tooltip.
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Specifies the event's predefined tooltip. The event's tooltip is shown once the cursor hovers the event. The value parameter supports ex-HTML format. |
Example
null {null}, undefined {undefined} or "" {string}, no tooltip for the event is displayed
"<img>image</img> and text" {string}, the image and text is being shown once the mouse pointer hovers the event. The image can be added using the exontrol.HTMLPicture.Add() method
SetToolTip
SetUserData(value)
The SetUserData() method associates any extra-data to the event
Parameters:
Name | Type | Description |
---|---|---|
value |
any | Indicates any extra-data to associate to the event |