BaseComponent
cdf.components. BaseComponent
The BaseComponent. Module which holds everything related to components.
AMD Module
require(["cdf/components/BaseComponent"], function(BaseComponent) { /* code goes here */ });
Extends
Base
Backbone.Events
Constructor
Holds the core functionalities present in all components.
Members
elapsedSinceSplit: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Protected
Number of milliseconds since the timer split.
elapsedSinceStart: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Protected
Number of milliseconds since the timer start.
htmlObject: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Protected
HTML element identifier where the component is rendered.
initInstance: [Number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
Deprecated Protected
The Dashboard instance to which the component belongs.
isDisposed: [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
Protected
The component is in a disposed state.
isManaged: [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
Protected
Managed flag.
logColor: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Protected
Color to use while logging messages.
name: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Protected
Name of the component.
postChange: [function](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function)
Function to be executed after the components parameter value changes.
preChange: [function](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function)
Function to be executed before the components parameter value changes.
timerSplit: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Protected
Start date for the timer split.
timerStart: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Protected
Start date for the timer start.
type: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Protected
Type of the component.
visible: [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
Protected
Visibility flag.
Methods
_disposeCore()Protected
Override this to (irreversibly) dispose of any resources which are not disposed of when simply removed.
_throwIfDisposed()Protected
Throws an error if the Dashboard is already disposed.
_unlink()Protected
Un-links the component without releasing the resources.
Clears the component HTML element.
clone(parameterRemap, componentRemap, htmlRemap): [cdf.components.BaseComponent](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.components.BaseComponent)
Clones a component.
General copy events methods.
Disposes this component, if it wasn't already disposed.
Focus the first placeholder DOM element on the component.
getAddIn(slot, addIn): [cdf.AddIn](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.AddIn)
Gets an add-in for this component.
getAddInOptions(slot, addIn): [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Gets an add-in option.
getValuesArray(): [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
Deprecated
Gets the values array property.
hasAddIn(slot, addIn): [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
Returns true
if the add-in with the provided subtype and name exists.
Prepares the component for removal.
parseArray(jData, includeHeader): [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
Deprecated
Builds an array with the data received from the server in another format.
parseArrayCda(jData, includeHeader): [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
Deprecated
Builds an array with the data received.
placeholder(selector): [jQuery](http://api.jquery.com/Types/#jQuery)
Getter for the component's DOM element.
Sets the options for an add-in.
Events
Event triggered by any other event.
Constructor Details
new BaseComponent(properties)
Constructs a BaseComponent.
Source:components/BaseComponent.js, line 170
properties : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Additional properties to be extended to the instance.
Name
Default Value
Summary
properties : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Additional properties to be extended to the instance.
## Members Details
elapsedSinceSplit: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Protected
Number of milliseconds since the timer split.
Source:components/BaseComponent.js, line 98
Default Value:-1
elapsedSinceStart: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Protected
Number of milliseconds since the timer start.
Source:components/BaseComponent.js, line 108
Default Value:-1
htmlObject: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Protected
The HTML element identifier, unique in the HTML page, where the component is rendered.
initInstance: [Number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
Deprecated Protected
The Dashboard instance to which the component belongs.
isDisposed: [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
Protected
The component is in a disposed state.
Source:components/BaseComponent.js, line 128
**Default Value:**false
isManaged: [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
Protected
logColor: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Protected
Color to use while logging messages.
Source:components/BaseComponent.js, line 118
**Default Value:**undefined
name: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Protected
The name of the component. Its name needs to be unique in the dashboard to which they belong.
postChange: [function](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function)
Function to be executed after the components parameter value changes.
preChange: [function](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function)
Function to be executed before the components parameter value changes.
timerSplit: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Protected
timerStart: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Protected
type: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Protected
The type of the component, usually the class name of the component.
visible: [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
Protected
## Methods Details
_disposeCore()Protected
Override this to (irreversibly) dispose of any resources which are not disposed of when simply removed.
_throwIfDisposed()Protected
Throws an error if the Dashboard is already disposed.
_unlink()Protected
Un-links the component without releasing the resources.
clear()
Clears the component HTML element.
clone(parameterRemap, componentRemap, htmlRemap) : [cdf.components.BaseComponent](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.components.BaseComponent)
Clones a component.
Source:components/BaseComponent.js, line 245
parameterRemap : [Object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Map containing parameter remapping.
componentRemap : [Object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Map containing component remapping.
htmlRemap : [Object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Map containing DOM element remapping.
[cdf.components.BaseComponent](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.components.BaseComponent)
The cloned component.
Name
Default Value
Summary
parameterRemap : [Object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Map containing parameter remapping.
componentRemap : [Object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Map containing component remapping.
htmlRemap : [Object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Map containing DOM element remapping.
Name
Description
[cdf.components.BaseComponent](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.components.BaseComponent)
The cloned component.
copyEvents(target, events)
General copy events methods. Given a target component and an event list, adds the component as a listener for all events in the list.
Source:components/BaseComponent.js, line 226
target : [cdf.components.BaseComponent](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.components.BaseComponent)
The target component object.
events : [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
Backbone.Events>
Backbone.Events list to copy.
Name
Default Value
Summary
target : [cdf.components.BaseComponent](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.components.BaseComponent)
The target component object.
events : [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
Backbone.Events>
Backbone.Events list to copy.
dispose()
Disposes this component, if it wasn't already disposed.
focus()
Focus the first placeholder DOM element on the component.
getAddIn(slot, addIn) : [cdf.AddIn](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.AddIn)
Gets an add-in for this component.
Source:components/BaseComponent.js, line 306
slot : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Add-in subtype.
addIn : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Add-in name.
[cdf.AddIn](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.AddIn)
Add-in registered with the specified name and subtype.
Name
Default Value
Summary
slot : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Add-in subtype.
addIn : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Add-in name.
Name
Description
[cdf.AddIn](https://help.hitachivantara.com/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/Documentation/Pentaho/Data_Integration_and_Analytics/10.0/Developer_center/Welcome_to_the_CDF_API_Documentation/cdf.AddIn)
Add-in registered with the specified name and subtype.
getAddInOptions(slot, addIn) : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Gets an add-in option.
Source:components/BaseComponent.js, line 516
slot : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The add-in subtype.
addIn : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The add-in name.
[object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
The options associated with the specified add-in.
Name
Default Value
Summary
slot : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The add-in subtype.
addIn : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The add-in name.
Name
Description
[object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
The options associated with the specified add-in.
getValuesArray() : [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
Deprecated
Gets the values array property, if one is defined. Otherwise, issues a call to the server to get data.
Source:components/BaseComponent.js, line 340
[Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
An array with values from the values array property or the data retrieved from the server.
Name
Description
[Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
An array with values from the values array property or the data retrieved from the server.
hasAddIn(slot, addIn) : [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
Returns true
if the add-in with the provided subtype and name exists.
Source:components/BaseComponent.js, line 323
slot : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Add-in subtype.
addIn : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Add-in name.
[boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
true
if the add-in exists, false
otherwise.
Name
Default Value
Summary
slot : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Add-in subtype.
addIn : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Add-in name.
Name
Description
[boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
true
if the add-in exists, false
otherwise.
onWillRemove()
Prepares the component for removal.
parseArray(jData, includeHeader) : [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
Deprecated
Builds an array with the data received from the server in another format.
Source:components/BaseComponent.js, line 414
jData : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Data object (Xaction or CDA) resulting from a call to the server.
includeHeader : [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
A boolean indicating whether the resulting array should include the headers.
[Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
/p
Name
Default Value
Summary
jData : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Data object (Xaction or CDA) resulting from a call to the server.
includeHeader : [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
A boolean indicating whether the resulting array should include the headers.
Name
Description
[Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
/p
parseArrayCda(jData, includeHeader) : [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
Deprecated
Builds an array with the data received from the server in CDA format.
Source:components/BaseComponent.js, line 457
jData : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Data object (CDA format) resulting from a call to the server.
includeHeader : [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
A boolean indicating whether the resulting array should include the headers.
[Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
The built data array in the CDA format.
Name
Default Value
Summary
jData : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Data object (CDA format) resulting from a call to the server.
includeHeader : [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)
A boolean indicating whether the resulting array should include the headers.
Name
Description
[Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<
object>
The built data array in the CDA format.
placeholder(selector) : [jQuery](http://api.jquery.com/Types/#jQuery)
Getter for the component's DOM element. Returns the jQuery object
that represents it.
Source:components/BaseComponent.js, line 181
selector : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Optional string
to append to the jQuery selector.
[jQuery](http://api.jquery.com/Types/#jQuery)
The matched DOM element or a new element if no match is found.
Name
Default Value
Summary
selector : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
Optional string
to append to the jQuery selector.
Name
Description
[jQuery](http://api.jquery.com/Types/#jQuery)
The matched DOM element or a new element if no match is found.
setAddInOptions(slot, addIn, options)
Sets the options for an add-in.
Source:components/BaseComponent.js, line 497
slot : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The add-in subtype.
addIn : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The add-in name.
options : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
An object with the options to use.
Name
Default Value
Summary
slot : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The add-in subtype.
addIn : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The add-in name.
options : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
An object with the options to use.
## Events Details
all
The all
event is a special event which will trigger the bound callbacks when any event occurs. This event is mainly used for logging purposes.
Source:components/_doc/events.jsdoc, line 19
**See also:**Backbone Events catalog.
## Type Definitions
TimerInfo: [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)
Static
The TimerInfo object.
timerStart : [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
The timer start date.
timerSplit : [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
The timer split value.
elapsedSinceStart : [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Number of milliseconds since timer start.
elapsedSinceStartDesc : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The formatted time since timer start.
elapsedSinceSplit : [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Number of milliseconds since timer split.
elapsedSinceSplitDesc : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The formatted time since timer split.
Name
Default Value
Description
timerStart : [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
The timer start date.
timerSplit : [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
The timer split value.
elapsedSinceStart : [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Number of milliseconds since timer start.
elapsedSinceStartDesc : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The formatted time since timer start.
elapsedSinceSplit : [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)
Number of milliseconds since timer split.
elapsedSinceSplitDesc : [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)
The formatted time since timer split.
Last updated
Was this helpful?