MainCatView.getSeriesTreeList

Syntax

getSeriesTreeList();

Description

The getSeriesTreeList method returns data sources tree.

Example

To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Process the DisplayTreeChanged event, and show the sources tree ID:

// Get tool ribbon
var ribbon = workbookBox.getRibbonView();
// Get the Home tab
var mainCatView = ribbon.getMainCategory();
// Get the Series Tree button
var dataSourceButton = mainCatView.getDataSourceButton();
// Display menu of the Series Tree button
var menu = dataSourceButton.getMenu();
menu.show();
// Get source tree
var seriesTreeList = mainCatView.getSeriesTreeList();
// Process the DisplayTreeChanged event
mainCatView.DisplayTreeChanged.add(function (sender, eventArgs) {
    console.log("The DisplayTreeChanged event is initiated");
});
// Output source tree identifier
console.log("Source tree identifier: " + seriesTreeList.getId());
// Hide menu of the Source Tree button
menu.hide();

After executing the example browser console displays ID of data sources tree, and after clicking the Series Tree button and initializing the DisplayTreeChanged event, an appropriate notice appears in the screen:

Sources tree ID: MetabaseTreeList20260

DisplayTreeChanged event initialized

See also:

MainCatView