This is a migrated thread and some comments may be shown as answers.

Set selected color to 'No Color' button

4 Answers 119 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Alexis
Top achievements
Rank 1
Alexis asked on 04 Aug 2014, 01:43 PM
Actually, when you press the 'No Color' button, the palette sets as no color the black color.

My question is if it's possible to set as 'No Color' the white color (#ffffff).

Regards,

Alexis Rosano.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Aug 2014, 08:35 AM
Hi Alexis,

Please try the below JavaScript code snippet to achieve your scenario.

JavaScript:
function pageLoad() {
    $('#RadColorPicker_emptycolor').click(function () {
        $('.rcpColorPreview')[0].style.backgroundColor = "white"; ;
    });
}

Thanks,
Shinu.
0
Alexis
Top achievements
Rank 1
answered on 06 Aug 2014, 01:31 PM
My RadcolorPicker is inside a RadPanelBar.

When I click the 'No color' button, it always set the color #808080.

I didn't get any error.
0
Shinu
Top achievements
Rank 2
answered on 07 Aug 2014, 05:19 AM
Hi Alexis,

Please do following modification in the JavaScript which works fine at my end.

JavaScript:
$('.rcpEmptyColor').click(function () {
    $('.rcpColorPreview')[0].style.backgroundColor = "white";
});

Thanks,
Shinu.
0
Misho
Telerik team
answered on 07 Aug 2014, 07:21 AM
Hello Alexis,

I've tried to replicate the described behavior on my side with RadColorPicker inside RadPanelBar but no avail. Here is a video showing my test:

http://screencast.com/t/WG1hv5Xf5pf

The issue might be related to some specific configuration of RadColorPicker control in your project.
Could you, please, prepare a sample project isolating the issue, so that we can further investigate it and come back to you with our findings.

You could also review the Client-side programming articles of RadColorPicker in our documentation.

Best Regards,
Misho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ColorPicker
Asked by
Alexis
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Alexis
Top achievements
Rank 1
Misho
Telerik team
Share this question
or