Get Started
Plugins
Macros
More information

window.Asc.plugin.executeMethod ("AddContentControlDatePicker", [args], callback)

Description

Defines the method that allows adding an empty content control datepicker to the document.

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("AddContentControlDatePicker", [datePickerPr, commonPr]);
Parameters
Parameter Description Type Example
datePickerPr Defines the content control datepicker properties:
  • DateFormat - a format in which the date will be displayed. For example: "MM/DD/YYYY", "dddd\,\ mmmm\ dd\,\ yyyy", "DD\ MMMM\ YYYY", "MMMM\ DD\,\ YYYY", "DD-MMM-YY", "MMMM\ YY", "MMM-YY", "MM/DD/YYYY\ hh:mm\ AM/PM", "MM/DD/YYYY\ hh:mm:ss\ AM/PM", "hh:mm", "hh:mm:ss", "hh:mm\ AM/PM", "hh:mm:ss:\ AM/PM",
    type: string,
    example: "DD\ MMMM\ YYYY";
  • Date - the current date and time,
    type: object,
    example: Date.
object
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
Returns

The method returns the undefined value.

Example
window.Asc.plugin.executeMethod ("AddContentControlDatePicker", [0, {"DateFormat" : "DD\ MMMM\ YYYY", "Date" : Date}, {"Id" : 7, "Tag" : "{tag}", "Lock" : 0}]);