Miscellaneous
14 Feb 20172 minutes to read
getValue
The getValue() method in the ColorPicker returns the hexadecimal value.
Add the following code example to the corresponding ASPX page to render the ColorPicker control.
<ej:ColorPicker runat="server" ID="colorpicker" Value="#278787"> </ej:ColorPicker>
Add the following code in the script section.
var ColorObj;
jQuery(function ($)
{
ColorObj = $("#<%=colorpicker.ClientID%>").ejColorPicker({ value: "#278787" }).data('ejColorPicker');
ColorObj.getValue();
});
setValue
The setValue() method in ColorPicker is used to set the color value. The given value is hexadecimal form.
Add the following code example to the corresponding ASPX page to render the ColorPicker control
<ej:ColorPicker runat="server" ID="colorpicker" ></ej:ColorPicker>
Add the following code in the script section.
var ColorObj;
jQuery(function ($)
{
ColorObj = $("#<%=colorpicker.ClientID%>").ejColorPicker().data('ejColorPicker');
ColorObj.setValue("#278787");
});
getColor
The getColor() method in ColorPicker control returns the color value in r,g,b form.
Add the following code example to the corresponding ASPX page to render the ColorPicker control
<ej:ColorPicker runat="server" ID="colorpicker" Value="#278787"> </ej:ColorPicker>
Add the following code in the script section.
var ColorObj;
jQuery(function ($)
{
ColorObj = $("#<%=colorpicker.ClientID%>").ejColorPicker({ value: "#278787" }).data('ejColorPicker');
ColorObj.getColor();
});