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

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

Number of milliseconds since the timer split.

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

Number of milliseconds since the timer start.

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

HTML element identifier where the component is rendered.

initInstancearrow-up-right: [Number](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)Deprecated Protected

The Dashboard instance to which the component belongs.

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

The component is in a disposed state.

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

Managed flag.

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

Color to use while logging messages.

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

Name of the component.

postChangearrow-up-right: [function](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function)

Function to be executed after the components parameter value changes.

preChangearrow-up-right: [function](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function)

Function to be executed before the components parameter value changes.

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

Start date for the timer split.

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

Start date for the timer start.

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

Type of the component.

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

Visibility flag.

Methods

Name
Description

Override this to (irreversibly) dispose of any resources which are not disposed of when simply removed.

Throws an error if the Dashboard is already disposed.

Un-links the component without releasing the resources.

Clears the component HTML element.

clone(parameterRemap, componentRemap, htmlRemap)arrow-up-right: [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)arrow-up-right: [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)arrow-up-right: [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)

Gets an add-in option.

getValuesArray()arrow-up-right: [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<objectarrow-up-right>Deprecated

Gets the values array property.

hasAddIn(slot, addIn)arrow-up-right: [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)arrow-up-right: [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<objectarrow-up-right>Deprecated

Builds an array with the data received from the server in another format.

parseArrayCda(jData, includeHeader)arrow-up-right: [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<objectarrow-up-right>Deprecated

Builds an array with the data received.

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

Getter for the component's DOM element.

Events

Name
Description

Event triggered by any other event.

Constructor Details

new BaseComponent(properties)

Constructs a BaseComponent.

Source:components/BaseComponent.js, line 170arrow-up-right

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 98arrow-up-right

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 108arrow-up-right

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 46arrow-up-right

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.

Source:components/BaseComponent.js, line 130arrow-up-right

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 128arrow-up-right

**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 66arrow-up-right

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

Source:components/BaseComponent.js, line 118arrow-up-right

**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 30arrow-up-right

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.

Source:components/BaseComponent.js, line 150arrow-up-right

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.

Source:components/BaseComponent.js, line 141arrow-up-right

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 88arrow-up-right

**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 78arrow-up-right

**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 38arrow-up-right

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

Visibility flag.

Source:components/BaseComponent.js, line 56arrow-up-right

**Default Value:**true

## Methods Details

_disposeCore()Protected

Override this to (irreversibly) dispose of any resources which are not disposed of when simply removed.

Source:components/BaseComponent.js, line 574arrow-up-right

_throwIfDisposed()Protected

Throws an error if the Dashboard is already disposed.

Source:components/BaseComponent.js, line 582arrow-up-right

_unlink()Protected

Un-links the component without releasing the resources.

Source:components/BaseComponent.js, line 561arrow-up-right

clear()

Clears the component HTML element.

Source:components/BaseComponent.js, line 214arrow-up-right

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)

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 226arrow-up-right

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.Eventsarrow-up-right>

dispose()

Disposes this component, if it wasn't already disposed.

Source:components/BaseComponent.js, line 531arrow-up-right

focus()

Focus the first placeholder DOM element on the component.

Source:components/BaseComponent.js, line 190arrow-up-right

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 306arrow-up-right

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)

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).<objectarrow-up-right>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 340arrow-up-right

Name

Description

[Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<objectarrow-up-right>

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 323arrow-up-right

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.

Source:components/BaseComponent.js, line 552arrow-up-right

parseArray(jData, includeHeader) : [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<objectarrow-up-right>Deprecated

Builds an array with the data received from the server in another format.

Source:components/BaseComponent.js, line 414arrow-up-right

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).<objectarrow-up-right>

/p

parseArrayCda(jData, includeHeader) : [Array](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).<objectarrow-up-right>Deprecated

Builds an array with the data received from the server in CDA format.

Source:components/BaseComponent.js, line 457arrow-up-right

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).<objectarrow-up-right>

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 181arrow-up-right

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 497arrow-up-right

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 allarrow-up-right 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 19arrow-up-right

**See also:**Backbone Events catalogarrow-up-right.

## Type Definitions

TimerInfo: [object](http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object)Static

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?