Miscellaneous in EJ 1 ASP.NET MVC ColorPicker
24 May 2017 / 1 minute to read
getValue
The getValue() method in ColorPicker returns the hexadecimal value.
- In the CSHTML page, configure the ColorPicker widget as follows.
@*In the CSHTML page, add the HTML helpers to render ColorPicker widget*@
@Html.EJ().ColorPicker("colorPicker").Value("#278787")
<script>
var ColorObj;
jQuery(function ($) {
ColorObj = $("#colorPicker").ejColorPicker({ value: "#278787" }).data('ejColorPicker');
ColorObj.getValue();
});
</script>
setValue
The setValue() method in ColorPicker is used to set the color value. The given value is in hexadecimal form.
- In the CSHTML page, configure the ColorPicker widget as follows.
@*In the CSHTML page, add the HTML helpers to render ColorPicker widget*@
@Html.EJ().ColorPicker("colorPicker")
<script>
var ColorObj;
jQuery(function ($) {
ColorObj = $("#colorPicker").ejColorPicker().data('ejColorPicker');
ColorObj.setValue("#278787");
});
</script>
getColor
The getColor() method in ColorPicker control returns the color value in r,g,b,a form.
- In the CSHTML page, configure the ColorPicker widget as follows.
@*In the CSHTML page, add the HTML helpers to render ColorPicker widget*@
@Html.EJ().ColorPicker("colorPicker").Value("#278787")
<script>
var ColorObj;
jQuery(function ($) {
ColorObj = $("#colorPicker").ejColorPicker({value: "#278787" }).data('ejColorPicker');
ColorObj.getColor();
});
</script>
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