Completed
Last Updated: 11 Sep 2020 13:13 by ADMIN
ADMIN
Ianko
Created on: 15 Sep 2015 08:11
Category: UI for ASP.NET AJAX
Type: Feature Request
0
Improve CustomColor button to update the CustomColorPallete according to the currently selected color

Currently, opening the CustomColorPallete popup always selects the #808080 color. To have this behavior use the custom code solution below:

<telerik:RadColorPicker runat="server" ID="RCP" EnableCustomColor="true" OnClientLoad="OnClientLoad" />

<script>
    function OnClientLoad(sender, args) {
        $telerik.$(sender._customColorButton).click(refreshPalette(sender));
    }

    function refreshPalette(sender) {
        return function (evt) {
            var colorPicker = sender;
            var selectedColor = colorPicker.get_selectedColor() || "#808080";
            colorPicker._updateHslPaletteElementsUI(colorPicker._getRgbFromHex(selectedColor), null, true);
        };
    }
</script>

0 comments