window.Asc.plugin.executeMethod ("AddContentControlList", [args], callback)
Defines the method that allows adding an empty content control list to the document.
This method should be used in the following way:
window.Asc.plugin.executeMethod ("AddContentControlList", [type, List, commonPr]);
Parameter |
Description |
Type |
Example |
type |
A numeric value that specifies the content control type. It can have one of the following values: 1 (comboBox) or 0 (drop-down list). |
number |
0 |
List |
A list of the content control elements that consists of two items:
-
Display - an item that will be displayed to the user in the content control list,
type: string,
example: "Item1_D";
-
Value - a value of each item from the content control list,
type: string,
example: "Item1_V".
|
array of objects |
|
commonPr |
Defines the common content control properties:
-
Id - a unique identifier of the content control. It can be used to search for a certain content control and make reference to it in the code,
type: number,
example: 0;
-
Tag - a tag assigned to the content control. The same tag can be assigned to several content controls so that it is possible to make reference to them in your code,
type: string,
example: "{tag}";
-
Lock - a value that defines if it is possible to delete and/or edit the content control or not,
type: number,
example: 0.
|
object |
|
The Lock parameter can have the following values:
Numeric value |
Edit |
Delete |
0 |
No |
Yes |
1 |
No |
No |
2 |
Yes |
No |
3 |
Yes |
Yes |
The method returns the undefined value.
window.Asc.plugin.executeMethod ("AddContentControlList", [0, [{Display: "Item1_D", Value: "Item1_V"}, {Display: "Item2_D", Value: "Item2_V"}], {"Id" : 7, "Tag" : "{tag}", "Lock" : 0}]);