MetaHierarchy.SelectedBreadcrumbAttributes

Syntax

SelectedBreadcrumbAttributes: Array;

Description

The SelectedBreadcrumbAttributes property determines the last attribute sequence defined in the breadcrumb.

Example

Before executing the example the MetaAttributeBreadCrumb component looks as follows:

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and the following code must be added in the event handler that processes document opening:

	//Get component for displaying and managing workbook attributes
	var breadcrumb = workbookBox.getDataView().getBreadcrumb();
	//Create array of selected attributes
	var selItems = [];
	//Get current hierarchy
	var hie = breadcrumb.getSource();
	var levs = hie.getLevels();
	var brCrAtts = hie.getSelectedBreadcrumbAttributes(); //Attributes selected in breadcrumb
	//Select all hierarchy attributes
	for (var k = 0; k < levs.length; k++)
	{						
		//Get level attributes
		var atts = levs[k].atts.its.it;
		if (atts.length > 0)
		{
			//Create an object that contains information about selected attributes
			selItems.push({
				Id: atts[0].id,
				Key: atts[0].k,
				Name: atts[0].n
			});
		}
		break;
	}
	//Calculate order of selected attributes for breadcrumb
	breadcrumb.setSelectedAttributes(selItems, false);
	//Refresh breadcrumb
	breadcrumb.refreshAll();

After executing the example the MetaAttributeBreadCrumb component will contain only one attribute:

See also:

MetaHierarchy