Skip to content

Interface: ComponentInterface

Hierarchy

  • ComponentInterface

Index

Methods

Methods

destroySettings

destroySettings(): void

Remove entry for current component in .settings

Returns: void


doActions

doActions(actions: any, propertyPath: any): void

Execute the actions provided by the actions editor from PropertiesPanel

Parameters:

Name Type Description
actions any
propertyPath any -

Returns: void


exportData

exportData(source: Object, callback: Object, options: Object): void

Export the full dataset from a datasource, using DeltaClient ExportApi.export

Parameters:

Name Type Description
source Object -
callback Object called with url to file
options Object e.g. can include focus for pivot queries

Returns: void


getDataSourceMap

getDataSourceMap(viewStatePaths: any, dataSourcePaths: any, propertyViewStates: any): any

Get Data Source mapping

Parameters:

Name Type Description
viewStatePaths any -
dataSourcePaths any -
propertyViewStates any

Returns: any


getProperty

getProperty(path: string): Object

Returns property value for a given path: onSettingsChange will keep a component updated with changes to its properties (including changes to any underlying bound view states) so getProperty is normally not necessary, assuming the component keeps a store of the changes. However, if required, a component can retrieve the current value of a property using getProperty.

Parameters:

Name Type Description
path string The path of the property.

Returns: Object

Value of the property. If the property is bound to a view state the value of the view state will be returned instead.


getPropertyMeta

getPropertyMeta(path: string): Object

Returns property information for a given path: If more information about a property is required, use getPropertyMeta.

Parameters:

Name Type Description
path string The path of the property.

Returns: Object

Property information: An object containing information about the property and, if applicable, its underlying view state. The response differs depending on the value set in the property.

Generic object properties are: path - path to the property type - type of the property, if it contains a data source or viewstate (data, viewstate or null)

If the property is a simple property or if it is bound to a view state the object also contains: value - value of the property

If the property is bound to a view state the object also contains: viewstateType - type of the underlying view state (symbol, int, etc) defaultValue - default value of the underlying view state


getTemplateViewStates

getTemplateViewStates(template: string): void

Extract view states from template and pass back their values

Parameters:

Name Type Description
template string

Returns: void


getViewState

getViewState(viewState: DocumentViewModel): String

Get the value of a given viewstate model

Parameters:

Name Type Description
viewState DocumentViewModel DocumentViewModel : Viewstate Model

Returns: String

The value of the model


hideErrorMessage

hideErrorMessage(): void

Hides the Dashboards error message on the component

Returns: void


hideQueryStatus

hideQueryStatus(): any

Hide query status

Returns: any


isBuildMode

isBuildMode(): boolean

Determines if the dashboard is in build mode

Returns: boolean

True if in build mode


isSelected

isSelected(): boolean

Determines if the component is selected

Returns: boolean

True if the component is selected


loadApp

loadApp(key: string, element: Object, settings: Object, options: Object, callback: any, namespace: any): void

Load a given app using requireJS and pass it a new API interface

Parameters:

Name Type Description
key string -
element Object -
settings Object either a Backbone model or an object containing the new app's settings
options Object an object of options to pass to the app initialize function
callback any -
namespace any -

Returns: void

appView


loadSetting

loadSetting(key: string, namespace: any): String

Load a setting from the .settings viewstate

Parameters:

Name Type
key string
namespace any

Returns: String

Value


navigate(options: string | Object): void

Navigate to a given dashboard/screen

Parameters:

Name Type Description
options string | Object Either a dashboard name or an object containing target dashboard, screen and/or viewstate parameters to pass

Returns: void


page

page(source: Object, options: any): any

Page a given data source

Parameters:

Name Type Description
source Object
options any -

Returns: any


saveSetting

saveSetting(key: string, value: string, namespace: any): any

Save a setting to the .settings viewstate

Parameters:

Name Type Description
key string -
value string
namespace any -

Returns: any


setProperty

setProperty(path: string, value: any, options?: any): void

Set the property at path to the given value: Most properties can optionally be bound to a view state by the user. If this is done, onSettingsChange will pass the value of the view state to the component, i.e. the component does not need to check if a property has been bound to a view state or not, it simply works off the value given by onSettingsChange. If the view state value is updated elsewhere in Dashboards, the new value will be passed to the component via onSettingsChange.

To set the value of these view states, use setProperty.

Parameters:

Name Type Description
path string The path of the property to set. If that property has been bound to a view state by the user, then the value of that view state will be set instead.
value any The value to set the property to.
options? any -

Returns: void


setViewState

setViewState(viewState: DocumentViewModel, value: any): boolean

Set the value of the given viewstate model

Parameters:

Name Type Description
viewState DocumentViewModel DocumentViewModel : Viewstate Model
value any -

Returns: boolean


showErrorMessage

showErrorMessage(errorObj: Object): any

Show a Dashboards error message on the component

Parameters:

Name Type Description
errorObj Object An object containing the error information: Error (description of the error) & Type (One of 'Error', 'Warning', 'Info')

Returns: any


showNotification

showNotification(visualConfig?: any, soundConfig?: any): any

Show notification

Parameters:

Name Type Description
visualConfig? any -
soundConfig? any

Returns: any


showQueryStatus

showQueryStatus(errorObj: any): any

Show Query Status

Parameters:

Name Type Description
errorObj any

Returns: any


subscribe

subscribe(source: DocumentDataModel, callback: any, raw?: boolean, pagingInfo?: any): void

Subscribe to a given source

Parameters:

Name Type Description
source DocumentDataModel DocumentDataModel : The data source to subscribe to. A data source can be retrieved from onSettingsChange as follows (this example assumes it is a data property called Data in a category called Basics)
callback any callback is a function that will be called when there is a data update. Three parameters will be passed to this callback: meta { columns: { add: [], remove: [], change: [], reset: [] } } data { add: [], remove: [], change: [], reset: [] } error
raw? boolean -
pagingInfo? any -

Returns: void


subscribeTemplateViewStates

subscribeTemplateViewStates(template: string, callback: any): void

Extract view states from template and pass their values to callback

Parameters:

Name Type Description
template string -
callback any

Returns: void


unsubscribe

unsubscribe(source: DocumentDataModel): void

Unsubscribe from a given source

Parameters:

Name Type Description
source DocumentDataModel DocumentDataModel : Data source

Returns: void


unsubscribeTemplateViewStates

unsubscribeTemplateViewStates(subscriptionId: string): void

Parameters:

Name Type Description
subscriptionId string

Returns: void


updateTable

updateTable(source: string, options: Object, successFunc: Function, errorFunc: Function): void

Updates the table in kdb

Parameters:

Name Type Description
source string -
options Object -
successFunc Function success callback
errorFunc Function error callback

Returns: void

undefined