getSelectionTimeRanges();
The getSelectionTimeRanges method returns the list of periods for selected series.
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), the metabase variable that contains an object for establishing a connection to repository, must be defined in the page, and the following code must be added in the document opening event handler:
//add a handler for repository connection end event
metabase.EndRequest.add(getSelectionTimeRanges);
function getSelectionTimeRanges()
{
//Get list of selected series periods
var timeRanges = wbk.getSelectionTimeRanges();
var startDate;
var endDate;
for (var range in timeRanges)
{
startDate = timeRanges[range].startDate;
endDate = timeRanges[range].endDate;
break;
}
//Display message about selected period
alert("Period selected: from "+ startDate+" to "+ endDate);
}
After executing the example a message indicating the selection period appears on selecting a cell area in workbook table.
See also: