getPathToKey(dim: PP.Mb.DimSource, args: Object, callback: Function | PP.Delegate, errorCallback: Function | PP.Delegate);
dim. Dictionary.
args. Operation arguments. An object must contain the following fields: selId - selection moniker; keysToLoad - keys of elements for loading; filter - filter of elements; fireEvent - indicates if the DimSrv.ChildLoaded event is called; if the argument is set to True, the event is called; getPathOnly - indicates if elements are obtained without adding data to model; if the argument is set to True, elements are obtained but not added to model.
callback. Callback function.
errorCallback. Callback function on error.
The getPathToKey method loads paths of elements with the specified keys.
Executing the example requires an instance of the DimSrv class named dimService (see DimSrv constructor). Get data of the element with the YEARS:1998 key:
// Get data of the element with the YEARS:1998 key var func = function(sender, args) { var res = JSON.parse(args.ResponseText); var elem = res.GetDimElementsResult.els.e[0]; console.log("Element key: " + elem.k); console.log("Element name: " + elem.n); } var args = { keysToLoad: ["YEARS:1998"], getPathOnly: True } dimService.getPathToKey(dim, args, func);
As a result the console displays data of the element with the YEARS:1998 key:
Element key: YEARS:1998
Element name: 1998
See also: