new Element(oElements, oElementOptsopt)
Defines additional properties and methods of the Element object (holds information(options) about an element within the control).
Every option of the Surface.ElementOptions type has associated a property of the control. For instance, the option:
caption {string}, defines the element's captionis associated with the property:
Caption {string}, defines the element's captionwhich means that the following statements are equivalent:
oElement.Options = {caption: "name"}where oElement is an object of Element type
oElement.SetOptions({caption: "name"})
oElement.Caption = "name"
oElement.SetCaption("name")
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
oElements |
Elements | Indicates an object of Elements type that's the owner collection of this element | |
oElementOpts |
Surface.ElementOptions |
<optional> |
defines the element's caption or options as an object of Surface.ElementOptions type |
Methods
Center(pool, lane, phase)
The Center() method centers the element within specified pool, lane or/and phase.
Parameters:
Name | Type | Description |
---|---|---|
pool |
any | The pool parameter could be any of the following:
|
lane |
any | The lane parameter could be any of the following:
|
phase |
any | The phase parameter could be any of the following:
|
- Since:
- 1.7
Example
For instance, the element.Center() method centers the element within its current pool, lane and phase
Center
GetLane() → {object}
The GetLane() method gets the lane of the pool that hosts the element, as an object of {i(ndex),c(aption),s(ize)} type. The center-point of the element determines the lane.
- Since:
- 1.7
Returns:
Returns null (the element is not hosted by any lane) or an object of {i(ndex),c(aption),s(ize)} type as epxlained:
- i(ndex) {number}, specifies the index of the lane (zero-based)
- c(caption) {string}, indicates the caption of the lane
- s(size) {number}, specifies the height of the lane
- Type
- object
GetPhase() → {object}
The GetPhase() method gets the phase of the pool that hosts the element, as an object of {i(ndex),c(aption),s(ize)} type. The center-point of the element determines the phase.
- Since:
- 1.7
Returns:
Returns null (the element is not hosted by any phase) or an object of {i(ndex),c(aption),s(ize)} type as epxlained:
- i(ndex) {number}, specifies the index of the phase (zero-based)
- c(caption) {string}, indicates the caption of the phase
- s(size) {number}, specifies the width of the phase
- Type
- object
GetPool() → {Pool}
The GetPool() method gets the element's pool.
- Since:
- 1.7
Returns:
Returns null (the element is not hosted by any pool) or an object of {Pool} type that specifies the element's pool
- Type
- Pool
SetLane(id)
The SetLane() method changes the element's lane (moves the element to a different lane)
Parameters:
Name | Type | Description |
---|---|---|
id |
any | The id parameter could be any of the following:
|
- Since:
- 1.7
SetPhase(id)
The SetPhase() method changes the element's phase (moves the element to a different phase)
Parameters:
Name | Type | Description |
---|---|---|
id |
any | The id parameter could be any of the following:
|
- Since:
- 1.7
SetPool(id)
The SetPool() method changes the element's pool (moves the element to a different pool)
Parameters:
Name | Type | Description |
---|---|---|
id |
any | The id parameter could be any of the following:
|
- Since:
- 1.7