getSetPeriodSettings (wbk, startDate, endDate);
wbk. Sets workbook value.
startDate. Sets starting date as 'YYYY-MM-DD'.
endDate. Sets end date as 'YYYY-MM-DD'.
The getSetPeriodSettings method returns period request body.
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), service named tsService used to work with time series, and also the user must add the following code in the event handler that processes document opening:
var getSetPeriodSettingsButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Period", //text Click: PP.Delegate(onClickGetSetPeriodSettings) }); function onClickGetSetPeriodSettings() { var wbk = args.Workbook; //Return body of period request var startDate = new Date(2010, 1, 1); var endDate = new Date(2012, 1, 1); var periodSettings = tsService.getSetPeriodSettings(wbk, startDate, endDate); //Execute request tsService._invokeRemoteProc(wbk, periodSettings, PP.Delegate(onResponse, this)); //Response get handler function onResponse(sender, args) { workbookBox.refreshAll(); alert(args.ResponseText); } }
After executing the example a button named Period is placed on the HTML page. On clicking this button the period request body is returned and shown in an appropriate message.
See also: