Miscellaneous
4 Aug 2017 / 2 minutes to read
getValue
The getValue() method in ColorPicker returns the hexadecimal value.
In the HTML page, add a <input> element to render ColorPicker widget
<input type="text" id="colorPicker" />
/// <reference path="tsfiles/jquery.d.ts" />
/// <reference path="tsfiles/ej.web.all.d.ts" />
module ColorPickerComponent {
$(function () {
var ColorObj;
var colorSample = new ej.ColorPicker($("#colorpick"), {
ColorObj = $("#colorPicker").ejColorPicker({ value: "#278787" }).data('ejColorPicker');
ColorObj.getValue();
});
});
}
setValue
The setValue() method in ColorPicker is used to set the color value. The given value is in hexadecimal form.
In the HTML page, add a <input> element to render ColorPicker widget
<input type="text" id="colorPicker" />
$(function () {
var colorSample = new ej.ColorPicker($("#colorpick"), {
})
colorSample.setValue("#278787");
});
getColor
The getColor() method in ColorPicker control returns the color value in r,g,b,a form.
In the HTML page, add a <input> element to render ColorPicker widget
<input type="text" id="colorPicker" />
$(function () {
var colorSample = new ej.ColorPicker($("#colorpick"), {
value: "#278787"
})
colorSample.getColor();
});
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page