HieService.setLevelsByAttributesIds

Syntax

setLevelsByAttributesIds (attributesIds, hie, callback);

Parameters

attributesIds. Sets the array that contains meta-attribute identifiers.

hie. Sets series hierarchy.

callback. Sets handler for operation execution end.

Description

The setLevelsByAttributesIds method sets tree levels in accordance with the meta-attributes order.

Example

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:

    var setLevelsByAttributesIdsButt = new PP.Ui.Button({
      ParentNode: document.body, //Parent DOM node
      Content: "Set levels", //Text      
      Click: PP.Delegate(onClick)     
     }); 
    
    function onClick()
    {  
    
     //Get a component used to display and control workbook attributes
     var breadcrumb = workbookBox.getDataView().getBreadcrumb();      
     //breadcrumb.refreshAll();
     var hie = breadcrumb.getHierarchy();
     //Get a service used to work with time series database hierarchy
     var hieService = tsService.getHieService();     
     //Determine tree levels according to order of metaattributes
     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:

HieService