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.

isDisposed : boolean
Protected

The component is in a disposed state.

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

Clones a component.

copyEvents(target, events)

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

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.

onWillRemove()

Prepares the component for removal.

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 170

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 130

isDisposed: boolean
Protected

The component is in a disposed state.

Source: components/BaseComponent.js, line 128

Default Value: false

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 150

preChange: function

Function to be executed before the components parameter value changes.

Source: components/BaseComponent.js, line 141

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

_disposeCore()
Protected

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

Source: components/BaseComponent.js, line 574

_throwIfDisposed()
Protected

Throws an error if the Dashboard is already disposed.

Source: components/BaseComponent.js, line 582

clear()

Clears the component HTML element.

Source: components/BaseComponent.js, line 214

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

Clones a component.

Source: components/BaseComponent.js, line 245

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 226

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

The target component object.

events : Array.<Backbone.Events>

Backbone.Events list to copy.

dispose()

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

Source: components/BaseComponent.js, line 531

focus()

Focus the first placeholder DOM element on the component.

Source: components/BaseComponent.js, line 190

getAddIn(slot, addIn) : cdf.AddIn

Gets an add-in for this component.

Source: components/BaseComponent.js, line 306

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 516

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 340

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 323

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.

onWillRemove()

Prepares the component for removal.

Source: components/BaseComponent.js, line 552

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

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

Source: components/BaseComponent.js, line 414

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 457

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 181

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 497

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 636