IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Would a hearty RTFM be impolite?
Assuming this is the control you are using. If not I apologize.

[link|http://www.telerik.com/help/radcalendar/v1_NET2/cldClientSideAPI.html|http://www.telerik.c...lientSideAPI.html]

Enable/Disable RadDatePicker Client-Side
To enable/disable DatePicker client-side, its DateInput.Enable() and DateInput.Disable() fucntions should be called. Here is a complete example:



[script type="text/javascript"]

function disable()
{
var datepicker = [%= RadDatePicker1.ClientID %];
datepicker.DateInput.Disable();
datepicker.PopupButton.onclick = null;
}

function enable()
{
var datepicker = [%= RadDatePicker1.ClientID %];
datepicker.DateInput.Enable();
datepicker.PopupButton.onclick = function()
{
datepicker.TogglePopup();
return false;
};
}
[/script]

[radCln:RadDatePicker ID="RadDatePicker1" runat="server" ][/radCln:RadDatePicker]

[a href="javascript:disable();"]Disable[/a]
[a href="javascript:enable();"]Enable[/a]


This may also be of use:

[link|http://msdn2.microsoft.com/en-us/library/3hc29e2a.aspx|http://msdn2.microso...ary/3hc29e2a.aspx]

--
Chris Altmann
New Yes
because I already have. I have tried the code that you have Copied and Pasted from their web site.

It doesn't work.

I have opened up a trouble ticket with them, and so far they admit that setting the control's Disable property doesn't prevent the user from clicking on the Popup button, having the calendar displayed, allowing the user to traverse through the calendar, and selecting a date which gets displayed in the DatePicker's "display". THAT is the action that SHOULD be disabled, but ISN'T.

All I can do is make the control invisible, which leaves a large empty space on the page, which makes my company's president not happy.
lincoln

"Chicago to my mind was the only place to be. ... I above all liked the city because it was filled with people all a-bustle, and the clatter of hooves and carriages, and with delivery wagons and drays and peddlers and the boom and clank of freight trains. And when those black clouds came sailing in from the west, pouring thunderstorms upon us so that you couldn't hear the cries or curses of humankind, I liked that best of all. Chicago could stand up to the worst God had to offer. I understood why it was built--a place for trade, of course, with railroads and ships and so on, but mostly to give all of us a magnitude of defiance that is not provided by one house on the plains. And the plains is where those storms come from." -- E.L. Doctorow


Never apply a Star Trek solution to a Babylon 5 problem.


I am not merely a "consumer" or a "taxpayer". I am a Citizen of the United States.


[link|mailto:bconnors@ev1.net|contact me]
New Works For Me
I grabbed the trial off their site and tried it using .Net 1.1 (VS 2003). It doesn't visually change the PopupButton but it removes the onclick handler of the hyperlink so it won't do anything when clicked. I bet you could add code in these functions to swap in a disabled button image or something.

Note that this code is manipulating two (actually more) different client side html controls/objects generated by the server side calendar controls.

DateInput is a hidden html input control that they appear to use behind the scenes and pass any changes (like calling Disable) via JS onto the separate visible input control.

PopupButton is a hyperlink that pops up the calendar when clicked. This code removes and reattaches the onlclick event handler to enable/disable that.

Yes, it would be nice if it did all this for you with one call to the object represented by the main ClientID (also a hidden html input control BTW), but it doesn't.
--
Chris Altmann
     Disabling 3rd party controls - (lincoln) - (15)
         2 hack solutions - (JayMehaffey) - (3)
             No hidden properties - (lincoln) - (2)
                 Your VP has the right idea. - (static) - (1)
                     We definitely purchased the controls - (lincoln)
         aspx control != html "control" - (altmann) - (10)
             here's the html for the control - (lincoln) - (9)
                 That's not the html... - (ChrisR) - (5)
                     Forgive me - (lincoln) - (1)
                         Problem was that the code you wrote to disable... - (ChrisR)
                     This is... - (lincoln) - (2)
                         Should be able to do it by hand - (JayMehaffey)
                         The original javascript... - (ChrisR)
                 Would a hearty RTFM be impolite? - (altmann) - (2)
                     Yes - (lincoln) - (1)
                         Works For Me - (altmann)

A McFrankenstein creation of various elements not utilized by the home cook.
40 ms