MetaHierarchy.ChildEls

Syntax

ChildEls: Object;

Description

The ChildEls property gets object children by specified key.

Example

To execute the example, in the HEAD tag of the HTML page specify links to the following CSS and JS files:

A time series database with the 112 key must be available.

In the <body> tag as the value of the onLoad attribute specify name of the function executed after page body loading is finished:

<body onload="Ready()">
	<div id='example'></div>
</body>

In the SCRIPT tag add the following script:

<script type="text/javascript">
	var metabase, hieSrv, hie;
	PP.ImagePath = "../Debug/img/";
	PP.ScriptPath = "../Debug/";
	PP.CSSPath = "../Debug/";
	function Ready() //body loading event handler
	{
		metabase = new PP.Mb.Metabase({
			Id: "WAREHOUSE",
			UserCreds: { UserName: "user", Password: "password" },
			Error: function (sender, args){alert(args.ResponseText);}
		});
		// Open repository connection
		metabase.open();
		hieSrv = new PP.Mb.HieService({ Metabase: metabase });
		// Create a service for working with time series
		tsService = new PP.TS.TSService({ Metabase: metabase });
		// Open document
		var wbk;
		tsService.openDocument(RUB_KEY, onWbkOpened);
		function onWbkOpened(sender, args)
		{
			wbk = args.Workbook;
			//Send request to open hierarchy of main directory of workbook indicators
			hieSrv.openFromSource (wbk, new PP.Delegate(onOpened), this));
		}
		function onOpened (d, res)
		{
			console.log(hieSrv);
			console.log(res);
		
			console.log("Get metadata hierarchy instance");
			hie = res.Args.Hier;
			console.log(hie);
			//Send request to get child elements
			hieSrv.getChildEls(hie, "", function(sender, res){
				console.log("Response for child element request is obtained");
				console.log(res);
			
			});
		}
	}
</script>

After executing the example the browser console displays JSON objects of metadata hierarchy instance and object children by specified key.

PP.Mb.MetaHierarchy {_RubricatorKey: 1334, _RubInstanceId:  null,_WorkbookInstanceId: null, _FilterFacts: Array[0], _Metabase: PP.Mb.Metabase…}
undefined

The value undefined indicates that the received object has no children

See also:

MetaHierarchy