ItemBars class (Gantt)

ItemBars(oItem)

new ItemBars(oItem)

The ItemBars object holds a collection of ItemBar objects. The ItemBar objects define the look and feel for bars in the item.
Parameters:
Name Type Description
oItem Item Specifies the item that holds the bar, as an object of Item type
ItemBars

Methods

Add(name, start, end, key, text) → {ItemBar}

The Add() method adds a bar for current item, and returns an object of ItemBar type
Parameters:
Name Type Description
name string Indicates the name of the bar to create or an object of ItemBarOptions type that specifies the options of the bar to create (single parameter)
start Date Specifies the date-time the bar starts from
end Date Specifies the date-time the bar ends to
key any Indicates the key of the bar to create
text string Specifies the bar's exHTML caption
Returns:
Returns undefined (adding the item-bar failed) or an object of ItemBar type that holds the bar being created
Type
ItemBar
Add

Clear()

The Clear() method removes all bars of the control
Clear

Item(key) → {object}

The Item() method gets the bar giving its index, key or reference
Parameters:
Name Type Description
key any The key parameter could be any of the following:
  • 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
  • key {ItemBar}, specifies the object reference to the bar to request for
Returns:
Returns null(the bar is not found), or an object of ItemBar type, if the bars collection contains the giving key.
Type
object
Item

Remove(key)

The Remove() method removes a bar from the collection.
Parameters:
Name Type Description
key any The key parameter could be any of the following:
  • 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
  • key {Bar}, specifies the object reference to the bar to request for
Remove

RemoveRange(range)

The RemoveRange() method removes multiple-bars at once
Parameters:
Name Type Description
range any Indicates a bar, an array of [Bar] type, or exontrol.Arr.
RemoveRange