PP.App.openAppModule

Syntax

openAppModule(moduleType: PP.App.ModuleType, settings: Object)

Parameters

moduleType. Unit type.

settings. Additional settings. The parameter is optional. It is a JSON object with the following properties: target - name of the new window where the unit will open (if this parameter is not defined the unit opens in the same window), OpenMode - window opening mode, mbObject - repository object with the key specified in the Key field.

Description

The openAppModule method opens unit with the specified type.

Example

Executing the example requires that the Foresight Analytics Platform web application is opened, and also there should be an express report with the 4960 key. The scenarios specified below must be started in the browser console.

Open the express report with the 4960 key in the view mode:

var mbObject = new PP.Mb.Object({
    Key: 4960 // Key of opened express report
});
// Determine settings for opening express report
var settings = {
    OpenMode: PP.App.OpenMode.Open, // Open for view
    mbObject: mbObject // Repository object
};
// Open express report with the 4960 key
PP.App.openAppModule(PP.App.ModuleType.Olap, settings);

After executing the example the express report with the 4960 key is opened. After it is loaded, execute the following script that determines key of opened express report, page name, and CSS class of its container:

// Determine key of the current express report
var key = PP.App.getQueryParam(PP.App.QueryParamEnum.Key);
console.log("Key of the current express report: " + key);
// Determine opened page name
var module = PP.App.getModuleByData(PP.App.ModuleType.Olap);
console.log("Opened page: " + module.Url);
// Get container with this unit
var node = PP.App.getModuleNode()
// Determine container CSS class
console.log("CSS class: " + node.className);

After executing the scenario the browser console displays key of the current express report, name of the page that contains this report and CSS class of report container:

Key of the current express report: 4960
Open page: olap.html
CSS class: PPPanelCnt

See also:

PP.App