getCurrentState();
The getCurrentState method returns current state for settings of the Data Sources Parameters tab in the Parameters dialog box.
The method returns a JSON object that has the following properties: destsVis - indicates if variants of data source display are shown, params - array of tab parameters: that is, JSON objects with the properties id (parameter identifier), k (key), value (value), and vis (indicates parameter visibility).
Executing the example requires that the HTML page contains the ParametersDialog component named parametersDialog (see Example of Creating the ParametersDialog Component). First deselect the menu items Show Data Source Display Variants in the Data Sources Parameters tab, and Data Source Names in Table in the Dimensions tab.Get current and initial states for settings defined for the Parameters dialog box tabs:
var currentState; var initState; var items = parametersDialog._ViewItems; // Get tabs of the Parameters dialog box for (var i = 0; i < items.length; i++) { // Get the current state of settings of the Data Sources Parameters tab var item= items[i]; currentState = item.getCurrentState(); // Get initial state of tab settings initState = item.getInitState(); switch (item.getTypeName()) { case "PP.Exp.Ui.ParametersDataSource": console.log("Display data source display options (current state):" + currentState.destsVis); if (initState != null) { console.log("Display data source display options (initial state): " + initState.destsVis); } break; case "ParametersDimensionsView": console.log("Output data sourc names in table (current state): "+ currentState.displaySourcesNames); if (initState != null) { console.log("Output data source names in table (initial state): " + initState.displaySourcesNames); } break; } }
After executing the example the user gets current and initial state of the settings defined for the Data Sources Parameters and Dimensions tab. For the first of these tabs the browser console, shows if the data source layouts are displayed, for the second tab it shows if the data sources names are shown in the table:
Show data source layouts (current state): False
Show data source layouts (initial state): True
Show data sources names in the table (current state): True
Show data sources names in the table (initial state): True
See also: