setLevelsByAttributesIds (attributesIds, hie, callback);
attributesIds. Sets the array that contains meta-attribute identifiers.
hie. Sets series hierarchy.
callback. Sets handler for operation execution end.
The setLevelsByAttributesIds method sets tree levels in accordance with the meta-attributes order.
To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component component), and add the following code in the document open event handler:
var setLevelsByAttributesIdsButt = new PP.Ui.Button({ ParentNode: document.body, //Parent DOM node Content: "Set levels", //Text Click: PP.Delegate(onClick) }); function onClick() { //Get component for displaying and managing workbook attributes var breadcrumb = workbookBox.getDataView().getBreadcrumb(); //breadcrumb.refreshAll(); var hie = breadcrumb.getHierarchy(); //Get service used to work with time series database hierarchy var hieService = tsService.getHieService(); //Set tree levels according to metaattribute order hieService.setLevelsByAttributesIds([], hie, PP.Delegate(onResponse)); } function onResponse(sender, args) { //Refresh workbook attribute wizard if (workbookBox.getPropertyBarView().getNavBreadcrumb()) { workbookBox.getPropertyBarView().getNavBreadcrumb().refresh(); } //Refresh breadcrumb workbookBox.getDataView().getBreadcrumb().setSelectedAttributes([], false); workbookBox.getDataView().getBreadcrumb().refreshAll(); }
After executing the example the button named Set Levels is placed in the HTML page. Clicking this button sets tree levels in accordance with metaattributes order.
See also: