HodrickPrescottFilterWizardView.CurrentState

Syntax

CurrentState: Object;

Description

The CurrentState property gets parameters for the Hodrick-Prescott filter.

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 Hodrick-Prescott filter parameters panel
	var parametersPanel = workbookBox.getPropertyBarView().getParametersPanel();
	console.log(parametersPanel);
	//Get non-linear regression parameter setup wizard
	var hodrickPrescottFilterWizard = parametersPanel._HodrickPrescottFilterWizard;
	//If a formula type of the selected series differs from Hodrick-Prescott Filter, clicking the 
	//"Get Current State" button displays a message that the Hodrick-Prescott filter parameters panel cannot be applied to the selected series
	if (!hodrickPrescottFilterWizard) return alert('Hodrick-Prescott filter parameters panel cannot be applied to the selected series. \n Select another series');
	//Get CurrentState of the Hodrick-Prescott parameters panel
	var state = hodrickPrescottFilterWizard.getCurrentState();
	alert(JSON.stringify(state));
}

After executing the example the page will contain the WorkbookBox component and a button named Get Current State. Click the Smoothing button in the Calculations ribbon tab, select the Hodrick-Prescott Filter item in drop-dwon menu; open the Parameters panel in the Series tab of the side panel, select any of the available parameters and click Get Current State. A message that contains specified parameters of smoothing appears in the screen. If other than the Hodric-Prescott Filter type is selected, clicking this button shows the following message: The Hodric-Prescott Filter parameters panel cannot be applied to the selected series. Select another series.

See also:

HodrickPrescottFilterWizardView