This is a migrated thread and some comments may be shown as answers.
Set focus to the ColorPicker control manually using the jquery function
1 Answer 8 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Smit asked on 18 Jun 2018, 10:48 AM
I need to set the focus to the Color Picker control from the user-defined jquery function.

Kindly Help, Thankx in Advance.

1 Answer, 1 is accepted

Sort by
Marin Bratanov
Telerik team
answered on 18 Jun 2018, 04:01 PM

I just answered your support ticket with this question and I am pasting the answer here as well for anyone else having the same query.

Here is an example that shows how you can use jQuery to traverse the DOM in order to get the element that you want to focus:

    <li>click the button</li>
    <li>press enter to expand the color picker</li>
 <asp:Button Text="focus color picker" ID="testBtn" OnClientClick="focusColorPicker(); return false;" runat="server" />
<telerik:RadColorPicker runat="server" ID="rcp1" RenderMode="Lightweight" ShowIcon="true"></telerik:RadColorPicker>
    function focusColorPicker() {
        //see more on referencing controls on the client here
        $telerik.$("[id^='rcp1']").find(".rcpIcon a").first().focus();

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Asked by
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question