ChildEls: Object;
The ChildEls property gets object children by specified key.
To execute the example, in the HEAD tag of the HTML page specify links to the following CSS and JS files:
PP.js.
PP.Metabase.js.
PP.Express.js.
PP.TS.js.
PP.css.
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.TS.HieService({ Metabase: metabase });
// Open time series database by its identifier and set callback
hieSrv.open(null, null, 1334, new PP.Delegate(onOpened));
function onOpened (d, res)
{
console.log(hieSrv);
console.log(res);
console.log("Get instance of metadata hierarchy");
hie = res.Args.Hier;
console.log(hie);
//Send a request for getting child elements
hieSrv.getChildEls(hie, "", function(sender, res){
console.log("Response for requesting child elements is received");
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.TS.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: