MarkZone class (Schedule)

MarkZone(oMarkZones)

new MarkZone(oMarkZones)

The MarkZone object holds the mark-zone of the control. The MarkZone(id) method returns the mark-zone based on its index or identifier/key.

Every option of the MarkZoneOptions type has associated a property of the MarkZone object. For instance, the option:

shape {string}, defines the shape for the mark-zone (applied on the schedule view only)
is associated with the property:
Shape {string}, defines the shape for the mark-zone (applied on the schedule view only)
which means that the following statements are equivalent:
oMarkZone.Options = {shape: "lime"}
oMarkZone.SetOptions({shape: "lime"})
oMarkZone.Shape = "lime"
oMarkZone.SetShape("lime")
where oMarkZone is an object of MarkZone type
Parameters:
Name Type Description
oMarkZones MarkZone Indicates an object of MarkZones type that's the owner collection of this mark-zone.

Members

Caption :string

The Caption property defines the ex-HTML caption of the mark-zone. The caption is displayed within the mark-zone, and it can be used to provide additional information about the highlighted time period. If the Caption property is not set or it is set to null, no caption is displayed within the mark-zone. The formatMarkZoneCaption field specifies the format and alignment to display the mark-zone's caption. By default, the Caption property is not defined, and no caption is displayed within the mark-zone.
Type:
  • string
Example
null {null}, resets the caption of the mark-zone
"caption" {string}, defines the plain-caption for the mark-zone
Caption

End :any

The End property defines the date/time when the mark-zone ends. The Start property indicates the date/time when the mark-zone begins. The Time property indicates the date/time of the mark-zone (simulates a timer, so Start, End, and Time are identical). Setting the Time property is equivalent to setting both Start and End properties to the same value.

The value of the End property can be specified as one of the following:

  • {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")
Type:
  • any
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
End

EventShape :any

The EventShape property defines the shape to apply on events that intersect the current mark-zone. You can use the EventShape property to highlight events that intersect the mark-zone by applying a specific shape to them. The Shape property defines the shape for the mark-zone (applied on the schedule view only). The TimeScaleShape property defines the shape for the mark-zone (applied on the time-scale only).

The value of the EventShape property could be any 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.Shapes.Schedule or exontrol.Shapes namespace
  • a CSS color
  • a JSON string-representation of an object of exontrol.Def.Shape type, for the mark-zone
  • an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
  • any
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.Schedule.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)
"Button" or exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace (@since 5.2)
EventShape

GroupID :any

The GroupID property defines the identifier of the group where the MarkZone object belongs. The group is used to associate the mark-zone with a specific group of the schedule, so that the mark-zone is displayed only on the schedule view of the associated group. If the GroupID property is not set or it is set to null, the mark-zone is not associated with any group, and it is displayed on all schedule views.
Type:
  • any
Example
null {null}, dissociates the mark-zone from any group
0 {number}, moves the mark-zone to the group with the index 0 (0-based)
"G1" {string}, moves the mark-zone to the group with the identifier "G1"
GroupID

(readonly) Index :number

The Index property retrieves the mark-zone's index. The index is a zero-based numeric value that indicates the position of the mark-zone within the mark-zones collection. The Schedule.MarkZone(id) method returns the mark-zone based on its index or identifier/key, so you can also use the index to request the mark-zone.
Type:
  • number
Example
The following statements are equivalents:

 oMarkZone.GetIndex(), retrieves the mark-zone's index
 oMarkZone.Index, retrieves the mark-zone's index

where oMarkZone is an object of MarkZone type
Index

Key :string

The Key property defines a key to the mark-zone, so you can request it by its key using the Schedule.MarkZone(key) method. If the Key property is not set or it is set to null, no key is associated with the mark-zone, and you cannot request it by a key, but you can request it by its index within the MarkZones collection using the Schedule.MarkZone(index) method.
Type:
  • string
Example
"logo" {string}, defines the mark-zone with the giving key (logo). You can use the oSchedule.MarkZone("logo") method to request the mark-zone giving its key.
Key

Options :MarkZoneOptions

The Options property defines the mark-zone's options (visibility, caption, ...) at once. This method allows you to update multiple settings of a mark-zone in a single call, providing a convenient way to modify the mark-zone's appearance and behavior on the control. You can pass an object of MarkZoneOptions type with the desired properties to change, and the method will apply those changes to the event accordingly.

Every option of the MarkZoneOptions type has associated a property of the MarkZone object. For instance, the option:

shape {string}, defines the shape for the mark-zone (applied on the schedule view only)
is associated with the property:
Shape {string}, defines the shape for the mark-zone (applied on the schedule view only)
which means that the following statements are equivalent:
oMarkZone.Options = {shape: "lime"}
oMarkZone.SetOptions({shape: "lime"})
oMarkZone.Shape = "lime"
oMarkZone.SetShape("lime")

It is important to note that changing a field of the Options object does not automatically update the mark-zone. For example, oMarkZone.Options.shape = "red" does not apply the change. Instead, you must assign the Options property again, such as oMarkZone.SetOptions({shape: "red"}), so the control updates and applies the new value.

Type:
Example
The following statements are equivalents:

 oMarkZone.Options = {shape: "red"}
 oMarkZone.SetOptions({shape: "red"})

where oMarkZone is an object of MarkZone type
Options

Repetitive :string

The SetRepetitive() method sets the format expression used to define the repetitive mark-zone. With a valid repetitive formula, the Start and End properties specify only the start and end time of the repetitive mark-zone, while the Repetitive expression determines all occurrence dates.

The value keyword indicates the date being queried in the format expression. The format expression is a boolean expression that defines the occurrence dates of the repetitive mark-zone by evaluating the date specified by the value keyword. The value keyword can be used with any date function or operator supported by the format expression, such as weekday(value) to get the weekday of the queried date, month(value) to get the month of the queried date, and so on. For instance, "weekday(value) = 1" means the mark-zone occurs every Monday.

Type:
  • string
Example
"" {string} or null {null}, the mark-zone is not repetitive (no effect)
"0" {string}, no occurrence
"1" {string}, the mark-zone occurs every day
"weekday(value) = 1" {string}, the mark-zone occurs every Monday
"weekday(value) in (1,2) and month(value) = 6", the mark-zone occurs every Monday and Tuesday, on June only
"value in (#6/8/2012#,#6/11/2012#,#6/20/2012#)", the mark-zone 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 mark-zone starts on 6/1/2012, and shows up every 5 days
Repetitive

Shape :any

The Shape property defines the shape for the mark-zone (applied on the schedule view only). The TimeScaleShape property defines the shape for the mark-zone (applied on the time-scale only). The "mark-zone" part of the Shapes property defines the shape for all mark-zones (which by default is shown as a light-grayed diagonal hatch). If the Shape property is specified, it is merged with the default shape for mark-zones (the "mark-zone" part of the Shapes property), and the resulting shape is applied on the schedule view of the mark-zone. The EventShape property defines the shape to apply on events that intersect the current mark-zone.

The value of the Shape property could be any 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.Shapes.Schedule or exontrol.Shapes namespace
  • a CSS color
  • a JSON string-representation of an object of exontrol.Def.Shape type, for the mark-zone
  • an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
  • any
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.Schedule.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)
"Button" or exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace (@since 5.2)
Shape

Start :any

The Start property defines the date/time when the mark-zone begins. The End property indicates the date/time when the mark-zone ends. The Time property indicates the date/time of the mark-zone (simulates a timer, so Start, End, and Time are identical). Setting the Time property is equivalent to setting both Start and End properties to the same value.

The value of the Start property can be specified as one of the following:

  • {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")
Type:
  • any
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
Start

Time :any

The Time property defines the date/time of the mark-zone (simulates a timer, so Time, Start, and End are identical). Setting the Time property is equivalent to setting both Start and End properties to the same value. The Start property indicates the date/time when the mark-zone begins. The End property indicates the date/time when the mark-zone ends.

The value of the Time property can be specified as one of the following:

  • {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")
Type:
  • any
Example
null {null}, indicates the current date and time (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
Time

TimeScaleShape :any

The TimeScaleShape property defines the shape for the mark-zone (applied on the time-scale only). The Shape property defines the shape for the mark-zone (applied on the schedule view only). The EventShape property defines the shape to apply to events that intersect the current mark-zone.

The value of TimeScaleShape property could be any 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.Shapes.Schedule or exontrol.Shapes namespace
  • a CSS color
  • a JSON string-representation of an object of exontrol.Def.Shape type, for the mark-zone
  • an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
  • any
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.Schedule.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)
"Button" or exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace (@since 5.2)
TimeScaleShape

Visible :boolean

The Visible property indicates whether the mark-zone is visible or hidden. You can use the Visible property to show or hide the mark-zone, without removing it from the control. If the Visible property is not set or it is set to null, the mark-zone is shown by default.
Type:
  • boolean
Example
false {boolean}, hides the mark-zone
true {boolean}, shows the mark-zone
Visible

Methods

Remove()

The Remove() method removes the mark-zone from the mark-zones collection. The MarkZones.Remove(id) method removes a mark-zone from the collection giving its index, identifier/key or reference. The MarkZones.Clear() method removes all mark-zones of the control.
Example
The following statements are equivalents:
 
 oSchedule.MarkZone(0).Remove(), removes the mark-zone of index 0
 oSchedule.MarkZones.Remove(0), removes the mark-zone of index 0

where oSchedule is an object of Schedule type
Remove