Skip to main content

getWidget()

returns the dhtmlxColorPicker widget attached to a ColorPicker control

getWidget(): Colorpicker;

Returns:

An object of the dhtmlxColorPicker widget.

Example

var colorpicker = form.getItem("colorpicker").getWidget();  // -> dhtmlxColorPicker

Related sample: Form. Get Widget Of Control

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

For example, you can set focus on the specified value in the control. To do this, you need to get the widget attached to the ColorPicker control and then use the setFocus() method of this widget.

var colorpicker = form.getItem("colorpicker").getWidget();  // -> ColorPickercolorpicker.setFocus("#BDF0E9"); // sets focus on the "#BDF0E9" color