Class: GV

GV(oGantt)

new GV(oGantt)

The GV class defines the chart's view, which displays the tasks of the chart, according with the chart's time-scale.
Parameters:
Name Type Description
oGantt Gantt Specifies an object of Gantt type that defines the owner control of the view to create.

Methods

EnsureVisibleClient(clientA, ensureOptsopt)

The EnsureVisibleClient() method ensures that the giving client fits the chart's client area.
Parameters:
Name Type Attributes Description
clientA object The client parameter could be any of the following:
  • clientA {object}, indicates an object of {ItemBar} type that indicates the item-bar to fit into the chart's client area
  • clientA {object}, indicates an object of {exontrol.Tree.Item} type that indicates the item to fit into the chart's client area
  • clientA {object}, indicates an object of {s(tart),e(nd),y,h(eight)} type as explained:
    • s(tart) {Date}, specifies the start of the range to fit the view
    • e(nd) {Date}, specifies the end of the range to fit the view
    • y {number}, specifies the y-offset (absolute) of the item to fit the view
    • h(eight) {number}, specifies the height (absolute) of the item to fit the view
ensureOpts object <optional>
Specifies different options to run the current method, as an object of {force, allowScale, allowScroll, nearestFit, duration, thisArg, cbkR, cbkI, cbkT}
Properties
Name Type Description
force boolean forces the EnsureVisibleClient()'s smooth operation to run, not matter if no zoom/scale or scroll changed
allowScale boolean updates the control's scale/zoom-factor to ensure full-fit the client
allowScroll number specifies whether horizontal/vertical is allowed as explained:
  • 3 {number}/{null}/{undefined}, allows scrolling horizontal and vertical as required
  • 0 {number}, no horizontal or vertical scroll is allowed
  • 1 {number}, horizontal scroll is allowed
  • 2 {number}, vertical scroll is allowed
nearestFit boolean ensures that corner of the object nearest the window's client area fits it (it has effect only if the size of the object is greater than size of the window's client area)
duration number specifies the time in ms the control is smoothly performs the changes
thisArg any specifies the value of "this" keyword during the cbkI/cbkT callbacks
cbkR callback specifies a function of callback(p) type that's invoked once the EnsureVisibleClient()'s smooth operation runs (p {number}, specifies the progress of the smooth so far, as a value between 0 and 1)
cbkI callback specifies a function of callback() type that's invoked once the EnsureVisibleClient()'s smooth operation begins
cbkT callback specifies a function of callback() type that's invoked once the EnsureVisibleClient()'s smooth operation ends

EnsureVisibleSelection(ensureOpts)

The EnsureVisibleSelection() method scrolls the control's content to ensure that the control's selection fits the control's client area
Parameters:
Name Type Description
ensureOpts object Specifies different options to run the current method, as an object of {expandParents, selection, duration} type
Properties
Name Type Description
expandParents number expands the parent-items as explained:
  • 0 {number}, no parent-item is expanded (ignored)
  • 1 {number}, the parent-item(s) is expanded
  • 2 {number}, ensure to fit the parent-item(s) as well
selection Array.<ItemBar> holds an array of item-bars as [ItemBar] type to fit into current-view. If missing the EnsureVisibleSelection() method scrolls the chart to ensure that the current chart's selection fits the chart's visible area.
duration number specifies the time in ms the control is smoothly performs the changes

GetFirstVisibleDate() → {Date}

The GetFirstVisibleDate() method gets the view's first visible date. The GetLastVisibleDate() method gets the view's last visible date.
Returns:
Returns the view's first visible date.
Type
Date
Example
The following statements are equivalents:

 oGantt.oGV.GetFirstVisibleDate(), gets the view's first visible date
 oGantt.oGV.FirstVisibleDate, gets the view's first visible date

where oGantt is an object of Gantt type

GetLastVisibleDate() → {Date}

The GetLastVisibleDate() method gets the view's last visible date. The GetFirstVisibleDate() method gets the view's first visible date.
Returns:
Returns view's last visible date
Type
Date
Example
The following statements are equivalents:

 oGantt.oGV.GetLastVisibleDate(), gets the view's last visible date
 oGantt.oGV.LastVisibleDate, gets the view's last visible date

where oGantt is an object of Gantt type

GetScrollRect() → {Array.<number>}

The GetScrollRect() method gets the current scroll-rectangle
Returns:
Returns the scroll-rectangle as an array of [x,y,width,height] type
Type
Array.<number>

GetVisibleRect() → {Array.<number>}

The GetVisibleRect() method indicates the control's visible rectangle
Returns:
Returns an array of [x,y,width,height] type that specifies the canvas's client rectangle
Type
Array.<number>

SetFirstVisibleDate(value)

The SetFirstVisibleDate() method changes view's first visible date
Parameters:
Name Type Description
value number | string | Date A value of one of the following types:
  • 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
  • value {null} or {undefined}, indicates the current date and time (equivalent of Now)
Example
The following statements are equivalents:

 oGantt.oGV.SetFirstVisibleDate("#12/31/1971#"), sets the view's first visible date
 oGantt.oGV.FirstVisibleDate = "#12/31/1971#", sets the view's first visible date

where oGantt is an object of Gantt type

Zoom(start, end, changeUnitWidthopt)

The Zoom() method zooms the view so the start-end interval fits the client's area.
Parameters:
Name Type Attributes Description
start number | string | Date A value of one of the following types:
  • date {string}, defines the date in string-format as "#MM/DD/YYYY[ HH:mm:ss]#"
  • date {Date}, indicates a JavaScript date to be copied
  • date {number} integer value representing the year of the date to be created
  • date {null} or {undefined}, indicates the current date and time (equivalent of Now)
      that defines the start of the interval
end number | string | Date A value of one of the following types:
  • date {string}, defines the date in string-format as "#MM/DD/YYYY[ HH:mm:ss]#"
  • date {Date}, indicates a JavaScript date to be copied
  • date {number} integer value representing the year of the date to be created
  • date {null} or {undefined}, indicates the current date and time (equivalent of Now)
      that defines the end of the interval
changeUnitWidth boolean <optional>
Specifies whether the chart's unit-width is changed (defaults to true)
Since:
  • 1.6