Hide control buttons in Color Picker Control

19 Dec 20221 minute to read

ColorPicker can be rendered without control buttons (Apply/Cancel). In this case, while selecting a color, the ColorPicker pop-up is closed and selected colors can be applied directly. To hide control buttons, set the showButtons property to false.

<div class='wrap'>
    <h4>Choose Color</h4>
    @Html.EJS().ColorPicker("element").ShowButtons(false).Render()
</div>

<style>
    .wrap {
        margin: 0 auto;
        width: 300px;
        text-align: center;
    }
</style>
public ActionResult ShowButtons()
    {
            return View();
    }

NOTE

View Sample in GitHub.