Skip to main content

getWidget()

returns the dhtmlxCalendar widget attached to a DatePicker control

getWidget(): Calendar;

Returns:

An object of the dhtmlxCalendar widget.

Example

var datepicker = form.getItem("datepicker").getWidget();  // -> dhtmlxCalendar

Related sample: Form. Get Widget Of Control

It is possible to use methods of dhtmlxCalendar via the getWidget() method of a DatePicker control.

For example, you can show the current month in the control. To do this, you need to get the widget attached to the DatePicker control and then use the showDate() method of this widget.

var datepicker = form.getItem("datepicker").getWidget();  // -> dhtmlxCalendardatepicker.showDate(null,"month"); // shows the current month