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 metabase connection end event handler metabase.EndRequest.add(getSelectionTimeRanges); function getSelectionTimeRanges() { //Get a list of periods for selected series var timeRanges = wbk.getSelectionTimeRanges(); var startDate; var endDate; for (var range in timeRanges) { startDate = timeRanges[range].startDate; endDate = timeRanges[range].endDate; break; } //Output message about the selected period alert("The period from "+ startDate+" to "+ endDate is selected); }
After executing the example a message indicating the selection period appears on selecting a cell area in workbook table.
See also: