Workbook.getDependentsSeries

Syntax

getDependentsSeries (value);

Parameters

value. Sets series.

Description

The getDependentsSeries method determines the list of series dependent on the specified series.

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 showDependantsButton = new PP.Ui.Button({
		ParentNode: document.body, //DOM parent node
		Content: "Display Information about Dependent Series", //Text
		Click: PP.Delegate(onClickCollapseSeries)
	});
				 
	function onClickCollapseSeries()
	{											
		var messageString = "";
		//Get workbook series
		var series = wbk.getActiveSheet().getSeries();
		var i;
		//Create a string that contains information about dependent series for each series
		for (i = 0; i < series.length; i++)
		{
			var dependantsSeries = wbk.getActiveSheet().getDependentsSeries(series[i])						
			if(dependantsSeries.length > 0)
			{
				messageString+= "The " + series[i].n + " series has dependent series: "; 
				while(dependantsSeries.length > 0)
				{
					messageString+= dependantsSeries.pop().n + ", ";
				}							
				messageString = messageString.slice(0, -2);							
					messageString+= '\n';
			}
			else
			{
				messageString+= "The " + series[i].n + " series does not have dependent series \n";
			}					
		}
		//Output the message
		alert(messageString);
	}

After executing the example a button named Show Information about Dependent Series is placed in the HTML page. Clicking this button shows a message that contains information on dependent series.

See also:

Workbook