new ItemBar(oIB, oOptionsopt)
Every option of the ItemBarOptions type has associated a property of the ItemBar object. For instance, the option:
caption {string}, specifies the caption to display within the baris associated with the property:
Caption {string}, specifies the caption to display within the barwhich means that the following statements are equivalent:
oItemBar.Options = {caption: "pointer"}where oItemBar is an object of ItemBar type
oItemBar.SetOptions({caption: "pointer"})
oItemBar.Caption = "pointer"
oItemBar.SetCaption("pointer")
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
oIB |
ItemBars | Indicates an object of ItemBars type that's the owner collection of this bar. | |
oOptions |
object |
<optional> |
Specifies an object of ItemBarOptions type that holds information about the bar, such as name, shape and so on. |
Members
AlignPercentCaption :number
The AlignPercentCaption property specifies the horizontal alignment of the bar's percent-caption, as one of the following value:
- 0, 1 or 2 the caption is not clipped and it is aligned to the left, center or right side of the bar ( no clip )
- 3, 4 or 5 the caption of the bar gets clipped to the bar's client area, else the caption is aligned to the left, center or right side of the bar ( clip, inside )
- 6, 7 or 8 the bar's caption is hidden if its size is less or equal with MinUnitWidth property, else if it does not fit the bar's client are, gets clipped or else fully aligned to left, center or right side of the bar ( hide if min, clip if not fit, inside )
- 9, 10 or 11 the bar's caption is hidden if it does not fit entirely into the bar's client area, else it is fully displayed aligned to the left, center or right side of the bar ( hide if not fit, no clip, inside )
- 12, 13 or 14 the bar's caption is displayed inside of the bar's client area if it fits entirely, else it is displayed outside of the bar aligned to the left, center or right ( no clip, inside, outside )
- 16, 17, 18, the bar's caption is displayed outside of the bar to the left or to the right ( no clip, outside )
By default, the percent-caption is 18, meaning that it is displayed outside of the bar to the right side.
Type:
- number
Example
0 {boolean}, the bar's percent-caption is aligned to the left
18 {number} or null {null}, the bar's percent-caption is displayed right-outside
AlignPercentCaption
(readonly) Bar :Bar
Type:
Example
The following statements are equivalents:
oItemBar.GetBar(), gets the gantt-bar associated with the current item-bar
oItemBar.Bar, gets the gantt-bar associated with the current item-bar
where oItemBar is an object of ItemBar type
Bar
CanBeLinked :boolean
Type:
- boolean
Example
false {boolean}, no link can start from, or end into the current bar
true {boolean} or null {null}, the bar can be linked
CanBeLinked
CanEndLink :boolean
Type:
- boolean
Example
false {boolean}, no link can end on this bar
true {boolean} or null {null}, any link can end on this bar
CanEndLink
CanMove :boolean
Type:
- boolean
Example
false {boolean}, the user can't move the item-bar
true {boolean} or null{null}, the user can move the item-bar by drag
CanMove
CanMoveToAnother :boolean
Type:
- boolean
Example
false {boolean} or null{null}, the user can't move the item-bar
true {boolean}, the user can move the item-bar from an item to another, by drag
CanMoveToAnother
CanResize :number
- 0 {number} or false {boolean}, the user can not resize the bar by drag
- -1 {number} or null {null}, the bar can be resized on both sides
- 1 {number} or true {boolean}, the bar can be resized on left side, and can not be resized on right
- 2 {number}, the bar can be resized on right side, and can not be resized on left
Type:
- number
Example
false {boolean}, the user can't resize the item-bar
true {boolean}, the user can resize the bar on left side, and can not be resize on right
-1 {number} or null {null}, the user can resize the bar on both sides
CanResize
CanResizePercent :boolean
Type:
- boolean
Example
false {boolean}, the bar's percent can not be resized by drag
true {boolean} or null {null}, the user can resize the bar's percent at runtime
CanResizePercent
CanStartLink :boolean
Type:
- boolean
Example
false {boolean}, no link can start from the current bar
true {boolean} or null {null}, any link can start from the current bar
CanStartLink
Caption :string
The caption supports exHTML format, including the <%=formula%> tag, where formula is an expression that supports predefined constants, operators and % keywords such as %0 (itembar's property), %C0 (cell's value), %CD0 (cell's extra-data) or %CS0 (cell' checkbox-state)
The expression supports the following keywords:%0, %1, %2, ... specifies the value/option of the item-bar as name, start, end and so on (ItemBarPropertyEnum type)
%C0, %C1, %C2, ... {string} specifies the caption of the cell, or the string the cell displays in the column with the index 0, 1 2, ... ( "%C0 + %C1", concatenates the caption of first and second cell )
%CD0, %CD1, %CD2, ... {any} specifies the cell's user-date in the column with the index 0, 1 2, ... ( "%CD0 ? value : ``", displays the cell's value only if the cell's data is not empty )
%CS0, %CS1, %CS2, ... {number} specifies the cell's state in the column with the index 0, 1 2, ... ( "(%CS0 ? `<b>` : ``) + value", displays the cell's value in bold only if the first cell is checked )
%CT0, %CT1, %CT2, ... {boolean} returns true if the cell displays a total field; otherwise, it returns false. The exTotalField / exTotalColumn flag specifies whether the cell displays a total field. For instance, "%CT1" refers to all cells in the second column that display totals, while "not %CT1" refers to all cells in the second column that do not display totals (@since 3.3)
%CE0, %CE1, %CE2, ... {boolean} returns true if the cell is editable; otherwise, it returns false.. For example, "%CE0" refers to all editable cells in the first column, while "not %CE1" refers to all cells in the second column that are read-only (@since 3.3)
%CC0, %CC1, %CC2, ... {number} retrieve the number of child items (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The ChildCount property returns the number of child items. For example, "%CC0" identifies all parent items, while "%CC0 = 0" identifies all leaf items (@since 3.3)
%CX0, %CX1, %CX2, ... {boolean} returns true if the item hosting the cell is expanded, or false if it is collapsed (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The Item.Expanded property specifically indicates whether the item is expanded or collapsed. For example, "%CX0" refers to all expanded items, while "not %CX0" identifies all collapsed items (@since 3.3)
Type:
- string
Example
"<b>task</b>" {string}, the item-bar displays the task string in bold
"<fgcolor white><bgcolor black> <%=%0%> " {string}, the item-bar displays its type/name in black/white
"<%=shortdate(%1)%><br><%=shortdate(%2)%>" {string}, the item-bar displays its start date-time in short format on the first line, and the end date-time in short format, on the second line
"<%=%C0 + %C1%>" {string}, concatenates and displays the caption of first and second cell
"<%=(%CD0 ? %0 : ``)%>" {string}, displays the first-column only if the item's data is not empty
"<b><%=(%CS0 ? %0 : ``)%></b><%=(%CS0 ? `` : %0)%>" {string}, displays the item-bar's name in bold only if the first cell is checked )
Caption
CaptionHOffset :number
Type:
- number
Example
0 {number}, null {null}, the bar's caption is shown at its alignment/default-position
-4 {number}, the bar's caption is shown 4-pixels left to its alignment/default-position
4 {number}, the bar's caption is shown 4-pixels right to its alignment/default-position
CaptionHOffset
CaptionVOffset :number
Type:
- number
Example
0 {number}, null {null}, the bar's caption is shown at its alignment/default-position
-4 {number}, the bar's caption is shown 4-pixels up to its alignment/default-position
4 {number}, the bar's caption is shown 4-pixels down to its alignment/default-position
CaptionVOffset
(readonly) CriticalPath :number
- 0, if the bar is not part of the critical path
- the position (1-based) of the bar in the critical path (In other words the current bar is part of the critical path, if the ItemBar.CriticalPath property is not 0. Any positive value indicates the position of the current bar in the critical path)
Type:
- number
Example
The following statements are equivalents:
oItemBar.GetCriticalPath(), indicates whether the current bar is part of the critical path (currently, the ItemBar.CriticalPath property specifies the position (1-based) of the bar in the critical path)
oItemBar.CriticalPath, indicates whether the current bar is part of the critical path (currently, the ItemBar.CriticalPath property specifies the position (1-based) of the bar in the critical path)
where oItemBar is an object of ItemBar type
CriticalPath
Duration :number
- 0 {number}, specifies the zero-length, so the item-bar's end margins is set to start
- positive {number}, the item-bar's end margins is set to start + duration
- negative {number}, the item-bar's start margins is set to end + duration
Type:
- number
Example
0 {number}, specifies the zero-length, so the item-bar's end margins is set to start
5 {number}, sets the item-bar's duration/length to 5 days
Duration
Effort :number|string
The Effort property could be:
- a numeric value which it is applied for all units in the task (constant-effort)
- a string that indicates the expression/formula to get the effort of the bar to be represented on the chart's histogram (variant-expression).
The expression/formula may contain the following keywords:
- value, {Date}indicates the date-time being queried
- start, {Date} indicates the starting point of the bar as indicated by ItemBar.Start property
- end, {Date} indicates the ending point of the bar as indicated by ItemBar.End property
The HistogramUnitCount property gets or sets the time-scale count to determine the effort of bars with variable-effort. The HistogramUnitScale property defines the time-scale unit to determine the effort of bars with variable-effort. For instance, the ItemBar.Effort on "weekday(value) in (0,6) ? 0 : 2", means that that effort to do the job is 2 for any day in the task, excepts the Sundays(0) and Saturdays(6) (weekend. For instance, the "(hour(value) > 5 and hour(value) < 18) ? 2 : 0" indicates that the bar's effort is 2 for any hour between 6AM and 18PM, and 0 for rest.
Type:
- number | string
Example
0 {number}, the bar is not represented into the control's histogram
1.5 {number}, the bar's histogram value is based on the bar's histogramType option as explained:
exHistOverload(0), adds 1.5-unit(s) to the histogram for each date-time of the bar
exHistOverAllocation(1), adds 150% to the histogram for each date-time of the bar (1 day long), 75% for a 2-days long or shortly effort divided by length (in days) (effort/length)
exHistOverAllocationFixed(512), adds 150% to the histogram for each date-time of the bar (no matter of its length) (fixed percent)
exHistOverAllocationMultiply(1024), adds 150% to the histogram for each date-time of the bar (1 day long), 300% for a 2-days long or shortly effort multiplied by length (in days) (effort*length)
"weekday(value) in (0,6) ? 0 : 2" {string}, defines an effort-expression or a variable-effort as explained: the effort to do the job is 2 for any day in the task, excepts the Sundays(0) and Saturdays(6) (weekend)
"weekday(value) = 1 ? 2 : 1" {string}, indicates that the effort to do the job is 2 for Mondays(1), else 1
"(month(value)=month(value+1)) ? 1 : 0" {string}, indicates that the effort to do the job is 1 for any day, excepts the last day in the month
"int((value-start)/86400000) ? 1 : 2" {string}, indicates that the effort to do the job is 2 for the first day in the task, and 1 for the others (86400000 represents the number of mili-seconds within a day, as 24 * 60 * 60 * 1000)
"(int((value-start)/86400000)+1) mod 2 ? 1 : 0" {string}, indicates that the effort to do the job is 2 for the first day in the task, and 1 for the others (86400000 represents the number of mili-seconds within a day, as 24 * 60 * 60 * 1000)
Effort
End :any
- value {null}, indicates the current date and time (equivalent of Now)
- value {string}, defines the date in string-format as "#MM/DD/YYYY[ HH:mm:ss]#"
- value {Date}, indicates a JavaScript date to be copied
- value {number} integer value representing the year of the date to be created
Type:
- any
Example
"#1/2/2001#" {string}, defines the bar's end date-time as January 2nd, 2001
Date.Today().NextDay(2) {Date}, changes the bar's end date-time to 1 day after tomorrow
End
ExtraCaption :string
The extraCaption supports exHTML format, including the <%=formula%> tag, where formula is an expression that supports predefined constants, operators and % keywords such as %0 (itembar's property), %C0 (cell's value), %CD0 (cell's extra-data) or %CS0 (cell' checkbox-state).
The expression supports the following keywords:%0, %1, %2, ... specifies the value/option of the item-bar as name, start, end and so on (ItemBarPropertyEnum type)
%C0, %C1, %C2, ... {string} specifies the caption of the cell, or the string the cell displays in the column with the index 0, 1 2, ... ( "%C0 + %C1", concatenates the caption of first and second cell )
%CD0, %CD1, %CD2, ... {any} specifies the cell's user-date in the column with the index 0, 1 2, ... ( "%CD0 ? value : ``", displays the cell's value only if the cell's data is not empty )
%CS0, %CS1, %CS2, ... {number} specifies the cell's state in the column with the index 0, 1 2, ... ( "(%CS0 ? `<b>` : ``) + value", displays the cell's value in bold only if the first cell is checked )
%CT0, %CT1, %CT2, ... {boolean} returns true if the cell displays a total field; otherwise, it returns false. The exTotalField / exTotalColumn flag specifies whether the cell displays a total field. For instance, "%CT1" refers to all cells in the second column that display totals, while "not %CT1" refers to all cells in the second column that do not display totals (@since 3.3)
%CE0, %CE1, %CE2, ... {boolean} returns true if the cell is editable; otherwise, it returns false.. For example, "%CE0" refers to all editable cells in the first column, while "not %CE1" refers to all cells in the second column that are read-only (@since 3.3)
%CC0, %CC1, %CC2, ... {number} retrieve the number of child items (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The ChildCount property returns the number of child items. For example, "%CC0" identifies all parent items, while "%CC0 = 0" identifies all leaf items (@since 3.3)
%CX0, %CX1, %CX2, ... {boolean} returns true if the item hosting the cell is expanded, or false if it is collapsed (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The Item.Expanded property specifically indicates whether the item is expanded or collapsed. For example, "%CX0" refers to all expanded items, while "not %CX0" identifies all collapsed items (@since 3.3)
Type:
- string
Example
"<b>task</b>" {string}, the item-bar displays the task string in bold
"<fgcolor white><bgcolor black> <%=%0%> " {string}, the item-bar displays its type/name in black/white
"<%=shortdate(%1)%><br><%=shortdate(%2)%>" {string}, the item-bar displays its start date-time in short format on the first line, and the end date-time in short format, on the second line
"<%=%C0 + %C1%>" {string}, concatenates and displays the caption of first and second cell
"<%=(%CD0 ? %0 : ``)%>" {string}, displays the first-column only if the item's data is not empty
"<b><%=(%CS0 ? %0 : ``)%></b><%=(%CS0 ? `` : %0)%>" {string}, displays the item-bar's name in bold only if the first cell is checked )
ExtraCaption
ExtraCaptionHAlign :number
- 0, 1 or 2 the caption is not clipped and it is aligned to the left, center or right side of the bar ( no clip )
- 3, 4 or 5 the caption of the bar gets clipped to the bar's client area, else the caption is aligned to the left, center or right side of the bar ( clip, inside )
- 6, 7 or 8 the bar's caption is hidden if its size is less or equal with MinUnitWidth property, else if it does not fit the bar's client are, gets clipped or else fully aligned to left, center or right side of the bar ( hide if min, clip if not fit, inside )
- 9, 10 or 11 the bar's caption is hidden if it does not fit entirely into the bar's client area, else it is fully displayed aligned to the left, center or right side of the bar ( hide if not fit, no clip, inside )
- 12, 13 or 14 the bar's caption is displayed inside of the bar's client area if it fits entirely, else it is displayed outside of the bar aligned to the left, center or right ( no clip, inside, outside )
- 16, 17, 18, the bar's caption is displayed outside of the bar to the left or to the right ( no clip, outside )
- 32 (0x20), which indicates that the bar's caption fits the bar and view (that bar's caption is aligned relative to the horizontal-intersection of the bar with the view).
Type:
- number
Example
null {null}, the item-bar's extra caption is horizontally centered
18 {number}, the item-bar's extra caption is displayed outside of the bar to the right ( no clip, outside )
ExtraCaptionHAlign
ExtraCaptionHOffset :number
Type:
- number
Example
0 {number}, null {null}, the bar's caption is shown at its alignment/default-position
-4 {number}, the bar's caption is shown 4-pixels left to its alignment/default-position
4 {number}, the bar's caption is shown 4-pixels right to its alignment/default-position
ExtraCaptionHOffset
ExtraCaptionVAlign :number
- 0, the caption is aligned to the top
- 1, the caption is vertically centered
- 2, the caption is aligned to the bottom
- 16 (0x10), The caption is displayed outside of the item-bar (16 outside on top, 18 outside on bottom)
- 32 (0x20), which indicates that the bar's caption fits the bar and view (that bar's caption is aligned relative to the vertical-intersection of the bar with the view).
Type:
- number
Example
null {null}, the item-bar's extra caption is vertically centered
18 {number}, the item-bar's extra caption is displayed outside of the bar to the bottom
ExtraCaptionVAlign
ExtraCaptionVOffset :number
Type:
- number
Example
0 {number}, null {null}, the bar's caption is shown at its alignment/default-position
-4 {number}, the bar's caption is shown 4-pixels up to its alignment/default-position
4 {number}, the bar's caption is shown 4-pixels down to its alignment/default-position
ExtraCaptionVOffset
HAlignCaption :number
- 0, 1 or 2 the caption is not clipped and it is aligned to the left, center or right side of the bar ( no clip )
- 3, 4 or 5 the caption of the bar gets clipped to the bar's client area, else the caption is aligned to the left, center or right side of the bar ( clip, inside )
- 6, 7 or 8 the bar's caption is hidden if its size is less or equal with MinUnitWidth property, else if it does not fit the bar's client are, gets clipped or else fully aligned to left, center or right side of the bar ( hide if min, clip if not fit, inside )
- 9, 10 or 11 the bar's caption is hidden if it does not fit entirely into the bar's client area, else it is fully displayed aligned to the left, center or right side of the bar ( hide if not fit, no clip, inside )
- 12, 13 or 14 the bar's caption is displayed inside of the bar's client area if it fits entirely, else it is displayed outside of the bar aligned to the left, center or right ( no clip, inside, outside )
- 16, 17, 18, the bar's caption is displayed outside of the bar to the left or to the right ( no clip, outside )
- 32 (0x20), which indicates that the bar's caption fits the bar and view (that bar's caption is aligned relative to the horizontal-intersection of the bar with the view).
Type:
- number
Example
null {null}, the item-bar's caption is horizontally centered
18 {number}, the item-bar's caption is displayed outside of the bar to the right ( no clip, outside )
HAlignCaption
Height :number
Type:
- number
Example
null {null}, the bar's height is defined by the height of the bar of the same type/name
-1 {number}, specifies that the bar's height is determined by the item's height (the item that hosts the bar defines the bar's height)
0 {number}, defines a zero-height bar (bar is hidden)
12 {number}, the bar's height is 12-pixels tall
Height
HistLegend :string
The histLegend supports exHTML format, including the <%=formula%> tag, where formula is an expression that supports
- predefined constants
- operators
- % keywords such as %0 (itembar's property), %C0 (cell's value), %CD0 (cell's extra-data) or %CS0 (cell' checkbox-state)
The expression supports the following keywords:
%0, %1, %2, ... specifies the value/option of the item-bar as name, start, end and so on (ItemBarPropertyEnum type)
%C0, %C1, %C2, ... {string} specifies the caption of the cell, or the string the cell displays in the column with the index 0, 1 2, ... ( "%C0 + %C1", concatenates the caption of first and second cell )
%CD0, %CD1, %CD2, ... {any} specifies the cell's user-date in the column with the index 0, 1 2, ... ( "%CD0 ? value : ``", displays the cell's value only if the cell's data is not empty )
%CS0, %CS1, %CS2, ... {number} specifies the cell's state in the column with the index 0, 1 2, ... ( "(%CS0 ? `<b>` : ``) + value", displays the cell's value in bold only if the first cell is checked )
%CT0, %CT1, %CT2, ... {boolean} returns true if the cell displays a total field; otherwise, it returns false. The exTotalField / exTotalColumn flag specifies whether the cell displays a total field. For instance, "%CT1" refers to all cells in the second column that display totals, while "not %CT1" refers to all cells in the second column that do not display totals (@since 3.3)
%CE0, %CE1, %CE2, ... {boolean} returns true if the cell is editable; otherwise, it returns false.. For example, "%CE0" refers to all editable cells in the first column, while "not %CE1" refers to all cells in the second column that are read-only (@since 3.3)
%CC0, %CC1, %CC2, ... {number} retrieve the number of child items (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The ChildCount property returns the number of child items. For example, "%CC0" identifies all parent items, while "%CC0 = 0" identifies all leaf items (@since 3.3)
%CX0, %CX1, %CX2, ... {boolean} returns true if the item hosting the cell is expanded, or false if it is collapsed (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The Item.Expanded property specifically indicates whether the item is expanded or collapsed. For example, "%CX0" refers to all expanded items, while "not %CX0" identifies all collapsed items (@since 3.3)
Type:
- string
- Since:
- 1.6
Example
"<b>cust</b>" {string}, the legend displays the cust string in bold
"<%=%0%> " {string}, the legend displays the bar's type/name
"<fgcolor gray><%=lower(%3)%>" {string}, the histogram-legend displays the bar's caption in gray and lowercase
HistLegend
Item :any
- item {number}, indicates a numeric value that defines the index of the item to request
- item {string}, specifies a string expression that defines the identifier/key of the item to request
- item {Item}, specifies the object reference to the item to request for
Type:
- any
- Since:
- 3.3
Example
The following statements are equivalents:
oItemBar.SetParent(item), sets the item to host the item-bar
oItemBar.Parent = item, sets the item to host the item-bar
oItemBar.SetItem(item), sets the item to host the item-bar
oItemBar.Item = item, sets the item to host the item-bar
where oItemBar is an object of ItemBar type
Item
Key :string
Type:
- string
Example
"A" {string}, defines a bar with the key "A"
Key
Move :number
Type:
- number
Example
3 {number}, moves the item-bar by 3 days forward
-2 {number}, moves the item-bar by 2 days backward
Move
Name :string
Type:
- string
Example
"Task" {string}, defines the current bar to look and act as a "Task" bar
"Task%Progress" {string}, defines the bar to look as a "Task" bar and to display the bar's "percent" option, as an inside "Progress"-bar. The Chart.Bars.Add("Task%Progress") should be previously called to define a bar of percent-type.
Name
Offset :number
Type:
- number
Example
0 {number} or null {null}, the item bar is shown in its default position, ussualy centered to the item, while it is not part of overlaid-bars
-4 {number}, shifts vertically the item bar by 4-pixels
Offset
Options :ItemBarOptions
oItemBar.Options = {caption: "pointer"}where oItemBar is an object of ItemBar type.
oItemBar.SetOptions({caption: "pointer"})
oItemBar.Caption = "pointer"
oItemBar.SetCaption("pointer")
Type:
Example
{caption: "pointer", canResize: 0} {ItemBarOptions}, defines the bar's caption to "pointer" and disables the bar's resizing at runtime
{canMove: false, canMoveToAnother: true} {ItemBarOptions}, disables the bar's moving within the same item, and enables the bar's moving to another item at runtime
Options
OverlaidKey :string
Type:
- string
Example
"Z" {string}, all overlaid-bars of the same overlaid-key "Z" are displayed on the same level
OverlaidKey
OverviewColor :string
Type:
- string
Example
"" {string} or null{null}, the overview color of the current item-bar is defined by the bar's overviewColor, item-bar's shape fill, pattern or frame color (the first truthy value in this order)
"transparent" or "rgba(0,0,0,0)" {string}, the overview representation of the current item-bar is hidden
"red" or "#FF0000", "rgb(255,0,0)", "rgba(255,0,0,1)", ... {string}, the current item-bar is shown in red within the control's overview
OverviewColor
Parent :any
- item {number}, indicates a numeric value that defines the index of the item to request
- item {string}, specifies a string expression that defines the identifier/key of the item to request
- item {Item}, specifies the object reference to the item to request for
Type:
- any
Example
The following statements are equivalents:
oItemBar.SetParent(item), sets the item to host the item-bar
oItemBar.Parent = item, sets the item to host the item-bar
oItemBar.SetItem(item), sets the item to host the item-bar
oItemBar.Item = item, sets the item to host the item-bar
where oItemBar is an object of ItemBar type
Parent
Percent :number
Type:
- number
Example
0 {number} or null {null}, the bar's percent is set to 0%
1 {number}, the bar's percent is set to 100%
Percent
PercentCaptionFormat :string
Type:
- string
Example
"" {string}, displays the bar's percent as it is (no % character is displayed)
"<b>%p%</b>" {string}, shows the bar's percent in bold
PercentCaptionFormat
Predecessor :string
- Finish to Start (FS), the predecessor ends before the successor can begin
- Start to Start (SS), the predecessor begins before the successor can begin
- Finish to Finish (FF), the predecessor ends before the successor can end
- Start to Finish (SF), the predecessor begins before the successor can end
The format of bar's predecessor is INDEX1["SF"|"FS"|"FF"|"SS"][KEY][:["W"]LAG|:LAG["W"]], where:
- INDEX1 is the 1-based index of the item that hosts the bar
- followed by the type of the link which can be one any of SF(Start-Finish), FS(Finish-Start), SS(Start-Start) or FF(Finish-Finish) sequence (FS if missing)
- continues with the KEY of the bar (empty is not used)
- and ends with the LAG of the link (specifies the delay the activity is postponed by the link). The "W" indicates a working-lag for the link (specifies the delay in working-units the activity is postponed by the link).
Type:
- string
- Since:
- 2.3
Example
"2FSZ", specifies that the current item-bar is linked with the "Z" bar of the second item (item with the index 1) using a Finish-Start link
"1SF:-2", adds a Start-Finish link with the bar '' of the first-item, using a lag of -2 days
Predecessor
ResizePercentStep :number
- only applies to user-driven resizing at runtime. Programmatic changes to exBarPercent ignore this step
- ensures that the bar snaps to predictable increments, making layout adjustments more consistent and controlled
The ResizePercentStep property indicates a unitary number between 0 and 1 that defines the resizing step, as explained:
- 0 (default), the bar can be resized freely to any value between 0% and 100%
- > 0, the bar resizes in fixed steps equal to the specified fraction of 100% of its container
Type:
- number
- Since:
- 5.0
Example
null {null} or {0}, the bar can be resized freely to any value between 0% and 100%
0.05 {number}, the bar moves in 5% increments
0.1 {number}, the bar moves in 10% increments
ResizePercentStep
ResourceFormat :string
- name {string}, indicates the name of the resource
- percent {number}, indicates the usage percentage of the resource as a value between 0 and 1
The expression can include exHTML tags to format the output, such as <b> for bold text, <font> for font styling, and <fgcolor> for foreground color. You can also use conditional logic and formatting functions to customize the display further.
The <%=%266%> sequence within the item-bar's caption displays the item's bar resource usage according to 'resourceFormat' field.Type:
- string
- Since:
- 3.2
Example
null {null}, displays the default format, equivalent of "name + ((percent - 1)? `[` + round(percent*100) + `%]` : ``)"
"name" {string}, displays just the name of the resource
"name + ((percent - 1)? `(` + round(percent*100) + `%)` : ``)" {string}, displays the name of the resource followed by its percentage in parentheses
ResourceFormat
Resources :string
- If the first character is a plus sign (+), the rest of the expression indicates the resources to be added to the current bar. For instance, if the current bar has the 'resources' property set to "R1,R2" and we set 'resources' to "+R3", it means that "R3" is added to the bar's resources, resulting in a new 'resources' property of "R1,R2,R3"
- If the first character is a minus sign (-), the rest of the expression indicates the resources to be removed from the current bar. For instance, if the current bar has the 'resources' property set to "R1,R2" and we set 'resources' to "-R2", it means that "R2" is removed from the bar's resources, resulting in a new 'resources' property of "R1"
- If no + or - character is used, setting the 'resources' property replaces its current value entirely. For example, if the current bar has 'resources' set to "R1,R2" and we set 'resources' to "R3,R4", it means the new 'resources' property will be "R3,R4". This replaces the previous resources with the new ones specified.
The <%=%49%> sequence within the item-bar's caption displays the item's bar resource usage, including the percentage if applicable.
Type:
- string
- Since:
- 3.2
Example
"R1,R2" {string}, allocates the R1 and R2 resources to the current bar
"R1[50%],R2[10%]" {string}, allocates 50% of R1 resources and 10% of R2 resource to the current bar
"+R3[34%]" {string}, adds 34% of R3 resource
Resources
Selectable :boolean
Type:
- boolean
Example
false {boolean}, the item-bar is unselectable (the user can select the item-bar)
true {boolean}, the item-bar is selectable
Selectable
Selected :boolean
Type:
- boolean
Example
false {boolean}, unselects the bar
true {boolean}, selects the bar
Selected
Shape :string
- the shape's name within the exontrol.Shapes.Tree or exontrol.Shapes namespace
- a CSS color
- a JSON string-representation of an object of exontrol.Def.Shape type, for the column itself
- an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
- string
Example
"" {string}, null {null}, no shape is 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.Gantt.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
ShowCaption :boolean
Type:
- boolean
Example
false {boolean}, hides the item-bar's caption
true {boolean}, shows the item-bar's caption
ShowCaption
ShowExtraCaption :boolean
Type:
- boolean
Example
false {boolean}, hides the item-bar's extra caption
true {boolean}, shows the item-bar's extra caption
ShowExtraCaption
ShowPercentCaption :boolean
Type:
- boolean
Example
false {boolean} or null {null}, the bar's percent-caption is hidden
true {boolean}, the bar's percent-caption is shown
ShowPercentCaption
Start :any
- value {null}, indicates the current date and time (equivalent of Now)
- value {string}, defines the date in string-format as "#MM/DD/YYYY[ HH:mm:ss]#"
- value {Date}, indicates a JavaScript date to be copied
- value {number} integer value representing the year of the date to be created
Type:
- any
Example
"#1/1/2001#" {string}, defines the bar's start date-time as January 1st, 2001
Date.Today() {Date}, changes the bar's start date-time to today
Start
Successor :string
- Finish to Start (FS), the predecessor ends before the successor can begin
- Start to Start (SS), the predecessor begins before the successor can begin
- Finish to Finish (FF), the predecessor ends before the successor can end
- Start to Finish (SF), the predecessor begins before the successor can end
The format of bar's successor is INDEX1["SF"|"FS"|"FF"|"SS"][KEY][:["W"]LAG|:LAG["W"]], where:
- INDEX1 is the 1-based index of the item that hosts the bar
- followed by the type of the link which can be one any of SF(Start-Finish), FS(Finish-Start), SS(Start-Start) or FF(Finish-Finish) sequence (FS if missing)
- continues with the KEY of the bar (empty is not used)
- and ends with the LAG of the link (specifies the delay the activity is postponed by the link). The "W" indicates a working-lag for the link (specifies the delay in working-units the activity is postponed by the link).
Type:
- string
- Since:
- 2.3
Example
"3SFy", specifies that the current item-bar is linked with the "y" bar of the third item (item with the index 1) using a Start-Finish link
Successor
SummaryBarShape :string
- the shape's name within the exontrol.Shapes.Tree or exontrol.Shapes namespace
- a CSS color
- a JSON string-representation of an object of exontrol.Def.Shape type, for the column itself
- an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
- string
Example
"" {string}, null {null}, no shape is 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.Gantt.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)
SummaryBarShape
ToolTip :string
The tooltip supports exHTML format, including the <%=formula%> tag, where formula is an expression that supports predefined constants, operators and % keywords such as %0 (itembar's property), %C0 (cell's value), %CD0 (cell's extra-data) or %CS0 (cell' checkbox-state)
The expression supports the following keywords:%0, %1, %2, ... specifies the value/option of the item-bar as name, start, end and so on (ItemBarPropertyEnum type)
%C0, %C1, %C2, ... {string} specifies the caption of the cell, or the string the cell displays in the column with the index 0, 1 2, ... ( "%C0 + %C1", concatenates the caption of first and second cell )
%CD0, %CD1, %CD2, ... {any} specifies the cell's user-date in the column with the index 0, 1 2, ... ( "%CD0 ? value : ``", displays the cell's value only if the cell's data is not empty )
%CS0, %CS1, %CS2, ... {number} specifies the cell's state in the column with the index 0, 1 2, ... ( "(%CS0 ? `<b>` : ``) + value", displays the cell's value in bold only if the first cell is checked )
%CT0, %CT1, %CT2, ... {boolean} returns true if the cell displays a total field; otherwise, it returns false. The exTotalField / exTotalColumn flag specifies whether the cell displays a total field. For instance, "%CT1" refers to all cells in the second column that display totals, while "not %CT1" refers to all cells in the second column that do not display totals (@since 3.3)
%CE0, %CE1, %CE2, ... {boolean} returns true if the cell is editable; otherwise, it returns false.. For example, "%CE0" refers to all editable cells in the first column, while "not %CE1" refers to all cells in the second column that are read-only (@since 3.3)
%CC0, %CC1, %CC2, ... {number} retrieve the number of child items (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The ChildCount property returns the number of child items. For example, "%CC0" identifies all parent items, while "%CC0 = 0" identifies all leaf items (@since 3.3)
%CX0, %CX1, %CX2, ... {boolean} returns true if the item hosting the cell is expanded, or false if it is collapsed (this keyword consistently returns identical results for all cells since it pertains to the item that hosts each cell). The Item.Expanded property specifically indicates whether the item is expanded or collapsed. For example, "%CX0" refers to all expanded items, while "not %CX0" identifies all collapsed items (@since 3.3)
Type:
- string
Example
"<b>task</b>" {string}, the tooltip displays the task string in bold
"<%=%0%> " {string}, the tooltip displays the bar's type/name
"Start: <%=shortdate(%1)%><br>End: <%=shortdate(%2)%>" {string}, the tooltip displays the bar's start date-time in short format on the first line, and the end date-time in short format, on the second line
"<%=%C0 + %C1%>" {string}, concatenates and displays the caption of first and second cell
"Duration: <%=((1:=int(0:= (%513))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s)' : '' ) + (=:1 ? ' ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')%>", {string} shows the item-bar's duration/length in days, hours and minutes
ToolTip
VAlignCaption :number
- 0, the caption is aligned to the top
- 1, the caption is vertically centered
- 2, the caption is aligned to the bottom
- 16 (0x10), The caption is displayed outside of the item-bar (16 outside on top, 18 outside on bottom)
- 32 (0x20), which indicates that the bar's caption fits the bar and view (that bar's caption is aligned relative to the vertical-intersection of the bar with the view).
Type:
- number
Example
null {null}, the item-bar's caption is vertically centered
18 {number}, the item-bar's caption is displayed outside of the bar to the bottom
VAlignCaption
Methods
DateToPercent(date) → {number}
Parameters:
| Name | Type | Description |
|---|---|---|
date |
any | Specifies the date to get percent for, as explained:
|
Returns:
- Type
- number
Example
oItemBar.DateToPercent("2024-01-01"), gets the percent of "2024-01-01" date relative to the start/end margins of the bar
oItemBar.DateToPercent(new Date(2024, 0, 1)), gets the percent of "2024-01-01" date relative to the start/end margins of the bar
DateToPercent
DefineSummaryBars(itemAdd, keyAdd)
Parameters:
| Name | Type | Description |
|---|---|---|
itemAdd |
any | Indicates an item-bar itself (one argument), or the item that hosts the item-bar (two arguments), as explained:
|
keyAdd |
any | indicates the key of the bar to include in the summary bar (null/undefined for keyMatch equivalent of all or "<*>"). The keyAdd parameter supports pattern if specified such as "
|
Example
oItemBar.DefineSummaryBars(0, "<*>"), includes all bars of all items into the summary bar
oItemBar.DefineSummaryBars(0, "<K*>"), includes bars whose key start with character K of all items into the summary bar
oItemBar.DefineSummaryBars(-1, "<*>"), includes all bars of direct descendent/children items into the summary bar
DefineSummaryBars
Remove()
Example
The following statements are equivalent:
oItemBar.Remove(), removes the item-bar from the item
oItemBar.Parent.Bars.Remove(oItemBar), removes the item-bar from the item
where oItemBar is an object of ItemBar type
Remove
UndefineSummaryBars(itemRemove, keyRemove)
Parameters:
| Name | Type | Description |
|---|---|---|
itemRemove |
any | Indicates an item-bar itself (one argument), or the item that hosts the item-bar (two arguments), as explained:
|
keyRemove |
any | indicates the key of the bar to exclude from the summary bar (null/undefined for keyMatch equivalent of all or "<*>"). The keyRemove parameter supports pattern if specified such as "
|
Example
oItemBar.UndefineSummaryBars(0, "<*>), excludes all bars of all items from the summary bar
oItemBar.UndefineSummaryBars(0, "<K*>), excludes bars whose key start with character K of all items from the summary bar
oItemBar.UndefineSummaryBars(-1, "<*>), excludes all bars of direct descendent/children items from the summary bar
UndefineSummaryBars