new Group(oGroups)
The Group object holds the group of the control. The Group(id) method returns the group based on its index or identifier.
Every option of the GroupOptions type has associated a property of the Group object. For instance, the option:
caption {string}, defines the caption of the group (the group's header displays its caption)is associated with the property:
Caption {string}, defines the caption of the group (the group's header displays its caption)which means that the following statements are equivalent:
oGroup.Options = {caption: "group"}where oGroup is an object of Group type
oGroup.SetOptions({caption: "group"})
oGroup.Caption = "group"
oGroup.SetCaption("group")
Parameters:
| Name | Type | Description |
|---|---|---|
oGroups |
Group | Indicates an object of Groups type that's the owner collection of this group. |
Members
Caption :string
The Caption property defines the caption of the group (the group's header displays its caption). If the Caption property is not specified, the ID property defines the caption of the group. If both Caption and ID properties are not specified, the index of the group defines the caption of the group. The ID property specifies the group's unique identifier. The Title property defines the title of the group (the group's title defines the caption of the group within the groups list, visible once the user clicks the drop-down grouping button). The MiscellaneousOptions.formatGroupCaption field specifies the format and alignment to display the group's caption.
Type:
- string
Example
null {null}, resets the caption of the group
"caption" {string}, defines the plain-caption for the group
Caption
EventShape :any
The EventShape property defines the shape to apply to events of the same group. The "event" part of the Shapes property defines the default shape to apply to events. Use the EventShape property to define a specific shape for events of a specific group, and so to highlight them from other groups. The EventShape property overrides the default shape defined for events, but does not override the shape defined for a specific event (using the Event.Shape property). The HeaderShape property defines the shape for the group's header. By default, the EventShape property is null, which means that no custom shape is applied to events of the same group (the default object's shape may be applied).
The value 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 group itself
- 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
HeaderShape :any
The SetHeaderShape() method sets the shape for the group's header. The "date-grouping-header" part of the Shapes property defines the default shape to apply to the date-grouping header. Use the HeaderShape property to define a specific shape for the header of a specific group, and so to highlight it from other groups. The EventShape property defines the shape to apply to events of the same group. By default, the HeaderShape property is null, which means that no custom shape is applied to the group's header (the default object's shape may be applied).
The value 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 group itself
- 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)
HeaderShape
ID :string
The ID property defines the group's unique identifier. The Schedule.Group() method gets a specific group given its identifier. The Event.GroupID property indicates the identifier of the group that the event belongs to. The Caption property defines the ex-HTML caption of the group (the group's header displays its caption). If the ID property is not specified, the Caption property defines the identifier of the group. If both ID and Caption properties are not specified, the index of the group defines the identifier of the group. The ID property is optional when groups are defined using the Groups property (as an object), since the property name serves as the group's identifier.
Type:
- string
Example
null {null}, the null value has no effect
"G1" {number}, defines the group with the identifier (G1). You can use the oSchedule.Group("G1") method to request the group giving its identifier.
ID
(readonly) Index :number
The Index property retrieves the group's index. The Schedule.Group() method gets a specific group given its index or identifier. The ID property defines the identifier of the group. The Caption property defines the ex-HTML caption of the group (the group's header displays its caption). If the ID property is not specified, the Caption property defines the identifier of the group. If both ID and Caption properties are not specified, the index of the group defines the identifier of the group. The ID property is optional when groups are defined using the Groups property (as an object), since the property name serves as the group's identifier.
Type:
- number
Example
The following statements are equivalents:
oGroup.GetIndex(), retrieves the group's index
oGroup.Index, retrieves the group's index
where oGroup is an object of Group type
Index
Options :GroupOptions
The Options property defines the group's options (visibility, caption, ...) at once. This method allows you to update multiple settings of a group in a single call, providing a convenient way to modify the group's appearance and behavior on the control. You can pass an object of GroupOptions type with the desired properties to change, and the method will apply those changes to the group accordingly.
Every option of the GroupOptions type has associated a property of the event. For instance, the option:
headerShape {string}, defines the shape for the group's headeris associated with the property:
HeaderShape {string}, defines the shape for the group's headerwhich means that the following statements are equivalent:
oGroup.Options = {headerShape: "red"}
oGroup.SetOptions({headerShape: "red"})
oGroup.HeaderShape = "red"
oGroup.SetHeaderShape("red")
It is important to note that changing a field of the Options object does not automatically update the group. For example, oGroup.Options.headerShape = "lime" does not apply the change. Instead, you must assign the Options property again, such as oGroup.SetOptions({headerShape: "lime"}), so the control updates and applies the new value.
Type:
Example
The following statements are equivalents:
oGroup.Options = {headerShape: "red", caption: "group"}
oGroup.SetOptions({headerShape: "red", caption: "group"})
where oGroup is an object of Group type
Options
Position :number
The Position property defines the group's position. The "group-drag" action of the allowActions field defines whether the user can change the position of groups by dragging and dropping them. By changing the position of a group, the user can change the order of groups among other groups. The position of a group indicates the order of the group among other groups. The group with the smallest position is shown in the first position (the leftmost column), and the group with the largest position is shown in the last position (the rightmost column). By default, the Position property is null, which means that groups are ordered by their addition order into the control (the first added group is shown in the first position, and so on).
Type:
- number
Example
null {null}, the null value has no effect
0 {number}, moves the group on the first position
Position
Title :string
The Title property defines the ex-HTML title of the group (the group's title defines the caption of the group within the groups list, visible once the user clicks the drop-down grouping button). The Group.Visible property indicates whether the group is visible or hidden. The ID property specifies the group's unique identifier. The Caption property defines the ex-HTML caption of the group (the group's header displays its caption). If the Title property is not specified, the Caption property defines the title of the group. If both Title and Caption properties are not specified, the ID property defines the title of the group, and lastly the index of the group defines the title of the group.
Type:
- string
Example
null {null}, indicates that that group's caption is also the group's title
"" {string}, shows no title for the group
"title" {string}, defines the plain-title for the group
Title
Visible :boolean
The Visible property shows or hides the group. The user can toggle the visibility of groups using the drop-down grouping button. When a group is hidden, its header is not displayed, and events belonging to that group are not displayed in the control. When a group is visible, its header is displayed, and events belonging to that group are displayed in the control.
The control displays groups if:
- ShowGroupingEvents property is True
- The Groups collection has visible elements. By default, the Groups collection contains no Group objects (Visible on True)
By default, the Visible property is true, which means that the group is visible.
Type:
- boolean
Example
false {boolean}, hides the group
true {boolean}, shows the group
Visible
Width :number
The Width property defines the group's width. The width of a group indicates the width of the column that shows events belonging to that group. The "group-resize" action of the AllowActions property defines whether the user can resize the width of groups. By default, the Width property is null, which means that all groups with width set to null are shown equally (the control calculates the width for each group with width set to null by dividing the available width for groups by the number of groups with width set to null).
Type:
- number
Example
-1 {number} or null {null}, all groups with width on null are shown equaly
128 {number}, defines the width of 128px
Width
Methods
Remove()
The Remove() method removes the group itself from the groups collection. The Schedule.Group(id) method returns the group based on its index or identifier (equivalent of this method). The Count property returns the number of groups within the collection. The Add, Remove and Clear methods updates the groups collection. The Item() method returns null if the group is not found, or an object of Group type, if the groups collection contains the giving id. You can use the Item and Count property to enumerate the groups within the collection. The Event.GroupID property defines the identifier of the group that event belongs to.
Example
The following statements are equivalents:
oSchedule.Groups.Remove("G1"), removes the group with the identifier "G1"
oSchedule.Group("G1").Remove(), removes the group with the identifier "G1"
where oSchedule is an object of Schedule type
Remove