Skip to main content
Pentaho Documentation

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

Constructor

Name Description
new BaseComponent(properties)

Holds the core functionalities present in all components.

Members

Name Description
elapsedSinceSplit : Number
 
Protected

Number of milliseconds since the timer split.

elapsedSinceStart : Number
 
Protected

Number of milliseconds since the timer start.

htmlObject : String
 
Protected

HTML element identifier where the component is rendered.

initInstance : Number
 
Deprecated
 
Protected

The Dashboard instance to which the component belongs.

isManaged : Boolean
 
Protected

Managed flag.

logColor : String
 
Protected

Color to use while logging messages.

name : String
 
Protected

Name of the component.

postChange : Function

Function to be executed after the components parameter value changes.

preChange : Function

Function to be executed before the components parameter value changes.

timerSplit : Number
 
Protected

Start date for the timer split.

timerStart : Number
 
Protected

Start date for the timer start.

type : String
 
Protected

Type of the component.

visible : Boolean
 
Protected

Visibility flag.

Methods

Name Description
clear()

Clears the component HTML element.

clone(parameterRemap, componentRemap, htmlRemap) : cdf.components.BaseComponent

Clones a component.

copyEvents(target, events)

General copy events methods.

focus()

Focus the first placeholder DOM element on the component.

getAddIn(slot, addIn) : cdf.AddIn

Gets an add-in for this component.

getAddInOptions(slot, addIn) : Object

Gets an add-in option.

getValuesArray() : Array.<Object>
 
Deprecated

Gets the values array property.

hasAddIn(slot, addIn) : Boolean

Returns true if the add-in with the provided subtype and name exists.

parseArray(jData, includeHeader) : Array.<Object>
 
Deprecated

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

parseArrayCda(jData, includeHeader) : Array.<Object>
 
Deprecated

Builds an array with the data received.

placeholder(selector) : jQuery

Getter for the component's DOM element.

setAddInOptions(slot, addIn, options)

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.

Source: components/BaseComponent.js, line 160

Parameters:
Name Default Value Summary
properties : Object  

Additional properties to be extended to the instance.

Members Details

elapsedSinceSplit: Number
 
Protected

Number of milliseconds since the timer split.

Source: components/BaseComponent.js, line 98

Default Value: -1

elapsedSinceStart: Number
 
Protected

Number of milliseconds since the timer start.

Source: components/BaseComponent.js, line 108

Default Value: -1

htmlObject: String
 
Protected

The HTML element identifier, unique in the HTML page, where the component is rendered.

Source: components/BaseComponent.js, line 46

initInstance: Number
 
Deprecated
 
Protected

The Dashboard instance to which the component belongs.

Source: components/BaseComponent.js, line 120

isManaged: Boolean
 
Protected

Managed flag.

Source: components/BaseComponent.js, line 66

Default Value: true

logColor: String
 
Protected

Color to use while logging messages.

Source: components/BaseComponent.js, line 118

Default Value: undefined

name: 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

Function to be executed after the components parameter value changes.

Source: components/BaseComponent.js, line 140

preChange: Function

Function to be executed before the components parameter value changes.

Source: components/BaseComponent.js, line 131

timerSplit: Number
 
Protected

Start date for the timer split.

Source: components/BaseComponent.js, line 88

Default Value: 0

timerStart: Number
 
Protected

Start date for the timer start.

Source: components/BaseComponent.js, line 78

Default Value: 0

type: String
 
Protected

The type of the component, usually the class name of the component.

Source: components/BaseComponent.js, line 38

visible: Boolean
 
Protected

Visibility flag.

Source: components/BaseComponent.js, line 56

Default Value: true

Methods Details

clear()

Clears the component HTML element.

Source: components/BaseComponent.js, line 204

clone(parameterRemap, componentRemap, htmlRemap) : cdf.components.BaseComponent

Clones a component.

Source: components/BaseComponent.js, line 235

Parameters:
Name Default Value Summary
parameterRemap : Object  

Map containing parameter remapping.

componentRemap : Object  

Map containing component remapping.

htmlRemap : Object  

Map containing DOM element remapping.

Returns:
Name Description
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 216

Parameters:
Name Default Value Summary
target : cdf.components.BaseComponent  

The target component object.

events : Array.<Backbone.Events>  

Backbone.Events list to copy.

focus()

Focus the first placeholder DOM element on the component.

Source: components/BaseComponent.js, line 180

getAddIn(slot, addIn) : cdf.AddIn

Gets an add-in for this component.

Source: components/BaseComponent.js, line 295

Parameters:
Name Default Value Summary
slot : String  

Add-in subtype.

addIn : String  

Add-in name.

Returns:
Name Description
cdf.AddIn

Add-in registered with the specified name and subtype.

getAddInOptions(slot, addIn) : Object

Gets an add-in option.

Source: components/BaseComponent.js, line 505

Parameters:
Name Default Value Summary
slot : String  

The add-in subtype.

addIn : String  

The add-in name.

Returns:
Name Description
Object

The options associated with the specified add-in.

getValuesArray() : 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 329

Returns:
Name Description
Array.<Object>

An array with values from the values array property or the data retrieved from the server.

hasAddIn(slot, addIn) : Boolean

Returns true if the add-in with the provided subtype and name exists.

Source: components/BaseComponent.js, line 312

Parameters:
Name Default Value Summary
slot : String  

Add-in subtype.

addIn : String  

Add-in name.

Returns:
Name Description
Boolean

true if the add-in exists, false otherwise.

parseArray(jData, includeHeader) : Array.<Object>
 
Deprecated

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

Source: components/BaseComponent.js, line 403

Parameters:
Name Default Value Summary
jData : Object  

Data object (Xaction or CDA) resulting from a call to the server.

includeHeader : Boolean  

A boolean indicating whether the resulting array should include the headers.

Returns:
Name Description
Array.<Object> /p
parseArrayCda(jData, includeHeader) : Array.<Object>
 
Deprecated

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

Source: components/BaseComponent.js, line 446

Parameters:
Name Default Value Summary
jData : Object  

Data object (CDA format) resulting from a call to the server.

includeHeader : Boolean  

A boolean indicating whether the resulting array should include the headers.

Returns:
Name Description
Array.<Object>

The built data array in the CDA format.

placeholder(selector) : jQuery

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

Source: components/BaseComponent.js, line 171

Parameters:
Name Default Value Summary
selector : String  

Optional string to append to the jQuery selector.

Returns:
Name Description
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 486

Parameters:
Name Default Value Summary
slot : String  

The add-in subtype.

addIn : String  

The add-in name.

options : 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
 
Static

The TimerInfo object.

Properties:
Name Default Value Description
timerStart : Number  

The timer start date.

timerSplit : Number  

The timer split value.

elapsedSinceStart : Number  

Number of milliseconds since timer start.

elapsedSinceStartDesc : String  

The formatted time since timer start.

elapsedSinceSplit : Number  

Number of milliseconds since timer split.

elapsedSinceSplitDesc : String  

The formatted time since timer split.

Source: components/BaseComponent.js, line 564