For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Name
Description

Holds the core functionalities present in all components.

Members

Name
Description

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

Name
Description

_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.

General copy events methods.

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.

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.

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.

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

Name
Description

all

Event triggered by any other event.

Constructor Details

new BaseComponent(properties)

Constructs a BaseComponent.

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.

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.

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.

Source:components/BaseComponent.js, line 46

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.

**Default Value:**false

isManaged: [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)Protected

Managed flag.

Source:components/BaseComponent.js, line 66

**Default Value:**true

logColor: [string](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string)Protected

Color to use while logging messages.

**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.

Source:components/BaseComponent.js, line 30

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.

Source:components/BaseComponent.js, line 88

**Default Value:**0

timerStart: [number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number)Protected

Start date for the timer start.

Source:components/BaseComponent.js, line 78

**Default Value:**0

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.

Source:components/BaseComponent.js, line 38

visible: [boolean](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)Protected

Visibility flag.

Source:components/BaseComponent.js, line 56

**Default Value:**true

## 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

getAddInOptions(slot, addIn) : [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)

Gets an add-in option.

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.

Name
Description

[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.

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.

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.

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.

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.

Name
Description

[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.

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.

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

Name
Description

[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.

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.

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.

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.

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.

placeholder(selector) : [jQuery](http://api.jquery.com/Types/#jQuery)

Getter for the component's DOM element. Returns the jQuery object that represents it.

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.

Name
Description

[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.

setAddInOptions(slot, addIn, options)

Sets the options for an 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.

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.

**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.

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.

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?