sisense.com

SisenseWidget

An object representing a Sisense widget.

Properties

NameTypeDescription
containerDOMElement<DIV>The DIV element to be used as a container for the widget
metadataWidgetMetadataContains an object representing the widget's metadata.
typestringContains the widget's primary type.
subtypestringContains the widget's sub-type.
affectDashboardFiltersbooleanContains true if the widget is a selector (clicking it will create a filter), false otherwise.
refreshingbooleanContains true if widget is currently refreshing, false otherwise.
idstringContains the widget's ID.
queryResultobjectContains the data returned for the widget's query from Sisense.
titlestringContains the widget's title.
$$modelWidgetThe internal widget instance - same as the widget object in a widget script

Note: the DIV element used for container must have an id as well as defined height and width dimensions for the widget to render correctly.

Constructor

Methods

on

on(event, callback)

Registers any widget events. For more information, see the Widget API reference.

Arguments

NameTypeRequiredDescriptionExample
eventstringyesA string value of the event name.'initialized'
callbackfunctionyesThe callback function to execute when the event is triggered.

Returns

N/A

Example

widget.on('initialized', (ev, args) => {
    console.log('dashboard initialized');
});

refresh

refresh()

Refreshes the widget.

Arguments

N/A

Returns

N/A

Example

widget.refresh();

getDrillItems

getDrillItems() -> MetaDataItem[]

Returns an array of items available for drill down.

Arguments

N/A

Returns

An array of Metadata Items

Example

console.log(widget.getDrillItems().length);

isDrillSupported

isDrillSupported() -> Object

Checks if the widget supports drill downs and returns an error if not.

Arguments

N/A

Returns

An object:

{
    supported: boolean
    error: 'string'
}

Example

console.log(widget.isDrillSupported().supported);

loadDrillItems

loadDrillItems()

Loads items available for drill down. This method should be run for a widget once and before running any other methods related to drilldown.

Arguments

N/A

Returns

Promise resolving to an array of Metadata Items

Example

widget.loadDrillItems().then((items) => {
    console.log(items);
});

loadDrillSuggestions

loadDrillSuggestions()

Loads suggested items for drill down.

Arguments

N/A

Returns

Promise resolving to an array of Metadata Items

Example

widget.loadDrillSuggestions().then((items) => {
    console.log(items);
});

performDrill

performDrill()

Performs a drill down.

Arguments

N/A

Returns

N/A

Example

widget.performDrill();

resetDrill

resetDrill()

Resets a drill down, reverting the widget back to its original state.

Arguments

N/A

Returns

N/A

Example

widget.resetDrill();
Last Updated: