Messages

The following messages may be configured or returned.

showErrorMessage

Show a KX Dashboards error message on the component

JavaScript

Copy
api.showErrorMessage(errorObj);

Parameters

errorObj

An object containing the description of the error.

parameter

description

error

Error description

type

One of Error, Warning or Info

Example

JavaScript

Copy
api.showErrorMessage({
    'error': 'Please define a data source',
    'type': 'Info'
});

Response

None

hideErrorMessage

Hides the KX Dashboards error message for the component.

JavaScript

Copy
api.hideErrorMessage();

onSettingsChange

The component should implement an onSettingsChange (settings) function to receive the settings from the KX Dashboards Properties Panel.

The full settings object is provided on load; for example:

JavaScript

Copy

    "Basics": { 
        "Data": "/"
    },
    "Style":{ 
        "Theme": "Dark",
        "AskFill": "#00ff00",
        "AskOpacity": 1,
        "BidFill": "#ff3300",
        "BidOpacity": 1
    }
}

Changes are passed only with a path to the changed property; for example:

JavaScript

Copy

    "Style.AskOpacity": 5
}