CurrentState: Object;
The CurrentState property determines the current parameters of seasonality model.
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and also add the following code in the handler, that processes document opening event:
var parametersPanel = workbookBox.getPropertyBarView().getParametersPanel(); var exponential = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Change period", //Text Click: PP.Delegate(onClickSetSource), Enabled: False }); //Turn the Change Period button to the state available to use parametersPanel.Toggling.add(PP.Delegate(function(){ var selSerie = wbk.getActiveSheet().getSelectedSeries()[0]; if(parametersPanel._isExponentialSmoothingSerie(selSerie)) { exponential.setEnabled(True); } else { exponential.setEnabled(False); } })); function onClickSetSource() { var exponentialSmoothingWizard = parametersPanel._ExponentialSmoothingWizard; //Get component's current state var state = exponentialSmoothingWizard.getCurrentState(); //Change period state.exponentialSmoothing.seasonalComponent.cycle = 5; //Set a new current state for the component exponentialSmoothingWizard.setCurrentState(state); }
After executing the example a WorkbookBox component and a button named Edit Period are placed in the HTML page. To execute the example, in the Calculations ribbon tab click the Forecasting button. Select Exponential Smoothing in drop-down menu and open the Parameters panel in the Series tab on side panel. Next click the Edit Period button. A new value will appear in the Period section of the Parameters panel.
See also: