SlideSmoothingWizardView.CurrentState

Syntax

CurrentState: Object;

Description

The CurrentState property gets moving average parameters.

Example

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 getCurrentStateButt = new PP.Ui.Button({
	ParentNode: document.body, //DOM parent node
	Content: "Get Current State", //Text
	Click: PP.Delegate(onClickGetCurrentState)
});
function onClickGetCurrentState()
	{
		//Get the panel, which must contain moving average parameters panel
		var parametersPanel = workbookBox.getPropertyBarView().getParametersPanel();
		console.log(parametersPanel);
		//Get moving average parameters panel
		var SlideSmoothingWizard = parametersPanel._SlideSmoothingWizard;
		//If a formula type of the selected series differs from Moving Average, clicking the button 
		//displays a message that the Moving Average panel cannot be applied to the selected series
		if (!SlideSmoothingWizard) return alert('moving average panel cannot be applied to the selected. \n Select another series'); 
		//Get CurrentState of moving average parameters panel
		var state = SlideSmoothingWizard.getCurrentState();
		alert(JSON.stringify(state));
	}

After executing the example the page will contain the WorkbookBox component and a button named Get Current State. To execute the example, click the Smoothing button in the Calculations ribbon tab, select Moving Average in drop-down menu, and also select the Series tab and open the Parameters panel in the workbook side panel. Edit any settings in the Parameters panel. After that click the Get Current State button, and a message that contains specified parameters of moving average appears in the screen. For the example execution, the selected series must have the Moving Average formula type, otherwise the user is informed that another series must be selected.

See also:

SlideSmoothingWizardView