GetParent

GetParent() → { ApiContentControlList }

Returns a parent of the content control list item in the combo box / dropdown list content control.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiContentControlList

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
Api.pluginMethod_AddContentControlList(1, [{Display: "Item1_D", Value: "Item1_V"}, {Display: "Item2_D", Value: "Item2_V"}], {"Id": 100, "Tag": "CC_Tag", "Lock": 3});
var aContentControls = oDocument.GetAllContentControls();
var oContentControlList = aContentControls[0].GetDropdownList();
oDocument.AddElement(0, oContentControlList);
var oItem = oContentControlList.GetItem(0);
oContentControlList = oItem.GetParent();
var oParagraph = Api.CreateParagraph();
var sType = oContentControlList.GetClassType();
oParagraph.AddText("The class type of the item parent element: " + sType);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "GetParent.docx");
builder.CloseFile();

Resulting document