Welcome Guest Search | Active Topics | Sign In | Register

How to change DatePicker format from the client? Options
Russell
Posted: Thursday, December 9, 2010 4:49:11 AM
Rank: Newbie
Groups: Member

Joined: 12/9/2010
Posts: 2
Hi,

I'm trialling your web controls and I need to be able to change the Date PickerFormat from Javascript on the client (I can do this fine from the server). Specifically, I want to be able to show/hide the time option depending on a checkbox on the page.

I can't see how to do this but I'm very new to your objects - it might be obvious! I can't see anything in this forum or the samples.

Can you help?

Cheers
eo_support
Posted: Thursday, December 9, 2010 9:31:29 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Unfortunately there is no way to do that on the client side. One alternative is to use two DatePickers set to two different formats, then use JavaScript to show/hide one of them when you need to switch format. However there is no way to change a DatePicker's format directly on the client side.

Thanks!
Russell
Posted: Thursday, December 9, 2010 9:39:45 AM
Rank: Newbie
Groups: Member

Joined: 12/9/2010
Posts: 2
Oh dear,

That is a problem. My main motivation (right now) for using EO's objects was the ability to use a "Date and Time" control without having to build one from other controls.

I'll take a look at the "two format" solution but it might actually be easier to build my own control from a date and a time picker from elsewhere.

I am a little surprised that no-one else has wanted to do this. It's for a simple diary app with an "all day" box for the event times. I would have thought the requirement was quite common.

Cheers, anyway

Russell
eo_support
Posted: Thursday, December 9, 2010 9:47:30 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Using two different DatePickers would definitely be the easiest way. You only need a few lines of code. Another way is to use an UpdatePanel/CallbackPanel to do the change on the server side without updating anything else. Dynamically changing format on the client side is the hardest way because it needs to modify quite some internal data and "recreate" a number of client side objects, which is probably is the most expensive way to do things with only slight performance gain over the two DatePicker method.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.