Skip to main content
Hitachi Vantara Lumada and 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.<<code>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.<<code>object>
Deprecated

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

parseArrayCda(jData, includeHeader) : Array.<<code>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.<<code>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.<<code>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.<<code>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.<<code>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.<<code>object> /p
parseArrayCda(jData, includeHeader) : Array.<<code>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.<<code>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