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

disable and enable not working for RadDatePicker

2 Answers 493 Views
Input
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Daniel asked on 27 Sep 2010, 12:49 AM
Hi. I'm trying to enable or disable the datepicker control from the client with the datepicker.enable() and datepicker.disable() but it doesn't seem to work. The browser throws an "object doesn't support this property or method". It works okay on a radtextbox control. Am I using the correct method? Thanks.

function ShowHideRefreshItems() {
                    var dp = $find("<%= rdpRefresh.ClientID %>");
                    //var textbox = $find("<%= rntSupportRef.ClientID %>");
                    if (dp.get_enabled())
                        dp.disable();
                    else
                        dp.enable();
                }

<asp:CheckBox ID="cbRefresh" runat="server" Text="Request a refresh of environment" ValidationGroup="vgEnvironmentUpdate" onclick="ShowHideRefreshItems()" />
<telerik:RadDatePicker ID="rdpRefresh" Skin="Default" runat="server" DateInput-ValidationGroup="vgEnvironmentUpdate"
                                    Enabled="false">
                                    <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x">
                                    </Calendar>
                                    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                    <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" ValidationGroup="vgEnvironmentUpdate">
                                    </DateInput>
                                </telerik:RadDatePicker>

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 27 Sep 2010, 06:38 AM
Hello,


For RadDatePicker, you need to use "set_enabled()" method to enable/disable the datepicker control.

Use the following client code:
function ShowHideRefreshItems() {
    var dp = $find("<%= rdpRefresh.ClientID %>");
    if (dp.get_enabled())
        dp.set_enabled(false);
    else
        dp.set_enabled(true);
}



-Shinu.
0
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
answered on 28 Sep 2010, 12:46 AM
Excellent! Thanks for the quick response Shinu.

Daniel
Tags
Input
Asked by
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Shinu
Top achievements
Rank 2
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or