Items class (Gantt)

Items()

new Items()

The Items type defines additional properties and methods of the Items(extree) type. The Items / GetItems() method returns the control's items collection.
Items

Methods

(static) GetDefSchedulePDM() → {DefSchedulePDM}

The GetDefSchedulePDM() method gets the options of the Items.SchedulePDM() method
Returns:
Returns an object of DefSchedulePDM type
Type
DefSchedulePDM
GetDefSchedulePDM

(static) GroupBars(itemBarA, startAopt, itemBarBopt, startBopt, groupBarsOptionsopt, optionsopt)

The GroupBars() method groups two bars, allowing you to associate a starting or ending point of one bar with any starting or ending point of another bar. For example, to move both bars together, you need to group the starting point of bar A with the starting point of bar B, and the ending point of bar A with the ending point of bar B. Use the GroupBars method to manage or control the distance between two bars. When bars are grouped, resizing or moving one bar in the group will resize or move the other bars in the group accordingly. Similarly, all related groups will also be adjusted when one group is resized or moved. You can group bars from different items. The GroupBars method can preserve the length of the bars, restrict the interval between bars, and perform other adjustments when changes occur in the group. The length of the bar and the interval between two bars are defined as follows:
  • length, the length of the bar is equivalent to its duration, which is the difference between the bar's ending date and its starting date
  • interval, The interval is the distance between the starting and ending points of the grouped bars. For example:
    • If the end of bar A is linked with the start of bar B, the interval is the difference between the starting date of bar B and the ending date of bar A
    • If the start of bar A is linked with the start of bar B, the interval is the difference between the starting date of bar A and the starting date of bar B
You can use the UngroupBars method to ungroup two or more item-bars. The GroupBars() method must provide 1, 4, or more arguments; otherwise, it has no effect. If the GroupBars() method provides a single argument, it can be an array of [ItemBar] type that holds all item-bars to group together.
Parameters:
Name Type Attributes Description
itemBarA ItemBar | Array.<ItemBar> Indicates the item-bar to group with itemBarB, or a collection of ItemBar objects to group together
startA boolean <optional>
Indicates whether the start(true) or end(false) margin of the item bar, are grouped with other bars
itemBarB ItemBar <optional>
Indicates the item-bar to group to
startB boolean <optional>
Indicates whether the start(true) or end(false) margin of the item bar, are grouped with other bars
groupBarsOptions GroupBarsOptionsEnum <optional>
Specifies how the bars are grouped together (exGroupBarsOptionNone if missing or not provided). For example, exPreserveBarLength + exFlexibleInterval indicates that the bars maintain their lengths, and bar B can be moved anywhere to the right of bar A. If 'groupBarsOptions' is exGroupBarsNone, the bars are not grouped.
options string <optional>
Indicates a string expression specifying a list of double values, separated by semicolons, which indicate the following in order: fixed interval; maximum value when the interval is increased; minimum value when the interval between bars is decreased. For example, "2;4" indicates that the interval between two bars should be 2 days, and the interval cannot exceed 6 days (2 + 4). Use the exLimitIntervalMin, exLimitIntervalMax, exLimitInterval, or exFlexibleInterval for the GroupBarsOptions parameter when specifying the range of values for the interval between bars.
Since:
  • 3.3
Example
GroupBars(oGantt.Chart.Selection), groups the all selected item-bars
 GroupBars([oGantt.ItemBar(0), oGantt.ItemBar(1)]), groups the item bars of the first and second rows
 GroupBars(oGantt.ItemBar(0), false, oGantt.ItemBar(1), true, "preserve,ignore","2") ' exPreserveBarLength + exIgnoreOriginalInterval, the distance between 2 bars is exactly 2 days.
GroupBars

(static) SchedulePDM(item, key) → {number}

The SchedulePDM() method arranges the activities on the plan based on the links / relationships / dependencies
Parameters:
Name Type Description
item any The item parameter could be any of the following:
  • item {null} or {undefined}, the key parameter indicates the unique key of the bar where SchedulePDM begins
  • 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 {exontrol.Tree.Item}, specifies the object reference to the item to request for
  • item {ItemBar}, specifies the bar where SchedulePDM begins (key parameter is ignored)
key any Specifies the key of the bar to request (not required if item points to an object of ItemBar type), as one of the following:
  • key {null} or {undefined}, specifies the first item-bar within the item (defaults to 0)
  • key {number}, indicates a numeric value that defines the index of the bar to request
  • key {string}, specifies a string expression that defines the key of the bar to request
Returns:
Returns 0 if successful, negative number if any error, or positive as warnings. The SchedulePDM() method can return any of the following:
  • 0 {number}, success
  • 1 {number}, (warning) no bar provided to SchedulePDM method
  • 2 {number}, (warning) single bar in SchedulePDM call
  • 3 {number}, (warning) SchedulePDM method is called during the BarResize event (possible a recursive call/stack overflow)
  • 4 {number}, (warning) no links between scheduled bars
  • -1 {number}, (error) possible cycling
  • -2 {number}, (error) can not move the base bar
  • -3 {number}, (error) scheduling the A and B bars fails
  • -4 {number}, (error) no IN bars
  • -5 {number}, (error) base bar is not initialized
  • -6 {number}, (error) source bar is not initialized (possible cycling)
  • -7 {number}, (error) target bar is not initialized (possible cycling)
  • -8 {number}, (error) no TRANSLATION bar
  • -9 {number}, (error) bar linked to itself. For instance, a bar linked to its summary bar
Type
number
SchedulePDM

(static) SetDefSchedulePDM(value)

The SetDefSchedulePDM() method sets the options for the SchedulePDM() method
Parameters:
Name Type Description
value DefSchedulePDM Indicates the options for the Items.SchedulePDM() method, as an object of DefSchedulePDM type
SetDefSchedulePDM

(static) UngroupBars(itemBarAopt, itemBarBopt)

The UngroupBars() method ungroups two or more item-bars. Use this method to ungroup bars that were previously grouped using the GroupBars method. If the itemBarA and itemBarB parameters are not specified or are missing, the UngroupBars() method will ungroup all item bars in the control. If only itemBarA is specified, the method will ungroup all item bars related to itemBarA. Similarly, if only itemBarB is specified, it will ungroup all item bars related to itemBarB.
Parameters:
Name Type Attributes Description
itemBarA ItemBar | Array.<ItemBar> <optional>
Specifies the first or multiple item-bars to ungroup
itemBarB ItemBar <optional>
Specifies the second item-bar to ungroup by
Since:
  • 3.3
Example
UngroupBars(), ungroups all item-bars of the control
UngroupBars