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

Persisting styles applied during server side OnDayRender and/or client side events

4 Answers 91 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Bob Pinna
Top achievements
Rank 1
Bob Pinna asked on 22 Jul 2008, 10:07 AM
I've read the recent posts on applying styles and/or CSS classes to day cells in the RadCalendar.  I have similar issues to those being reported by others - most importantly that styles applied during the server side OnDayRender are wiped out by hovering over the day on the client side.

The two solutions offered in previous responses are to wrap the calendar in an asp update panel or to use the SpecialDays collection.  The asp update panel exhibits the same problem - I think that only solves client side OnDayRender event firing time issues.  Using SpecialDays in our application is problematic because there are several attributes we are trying to convey visually that are orthogonal to one another.  For example, person and location.  SpecialDays would require enumerating each combination and both are large sets.

So, the first question, is there a workaround for preventing styles from being wiped out by a hover (or select) event on the client?  We don't mind hooking prototypes.

Next set of questions...

What we really want to do is override the date click event on the client side.  When the date click event occurs we want to style the day based on a set of dropdowns that the user has selected.

For example, imagine two dropdowns of person and location.  The user sets the "active" person and "active" location.  When they click on the date, color gets set to indicate person and the text is changed to indicate location.  We would also fire off a web services event to keep the server in sync as opposed to doing a general postback (we've read the topics on how this requires the asp script manager).

This brings up the following questions:

1.  We're using the MultiMonth view which  requires AutoPostBack=true.  We would like to simply always cancel the selection by using args.set_cancel(true) in the client side event OnDateSelecting.  If we do this, are we correct that a postback event will only occur on navigation?
2. We've tried applying styles during OnDateClick.  They get wiped out by the focus styles.  Can we apply appearance styles during OnDateClick that will not be wiped out by hovering, focus, etc?  If so, how?

And...

If we do end up having to enumerate all of the special days, is it possible to add and remove dates from the special days collection via the client side API (assuming all templates are pre-defined).



4 Answers, 1 is accepted

Sort by
0
Bob Pinna
Top achievements
Rank 1
answered on 22 Jul 2008, 11:30 AM
I noticed your client-side OnDayRender sample did not exhibit the hover wiping out styles issue.  I upgraded from SP1 to SP2 and that does fix at least part of the problem - namely styles applied in the server side OnDayRender are restored correctly after a hover.

Would still appreciate a reply to the other questions regarding what we would like to accomplish from the client side OnDateClick.
0
Missing User
answered on 25 Jul 2008, 10:22 AM
Hi Bob,


Up to your questions:

1) You are right, you can handle the OnDateSelecting event to cancel the selection.

2) This feature is not supported by RadCalendar. We've logged it in our system and will do our best to implement it in a future release of the RadCalendar control.




Regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob Pinna
Top achievements
Rank 1
answered on 25 Jul 2008, 08:32 PM
I saw another forum topic on how to force a client side day render event (i.e., raise_dayRender).  Is there some way to do #2 below, where we would combine with 1 and 3 to get the client side capability we're looking for:

1. In the OnDateClick, we store the person and location attributes associated with the clicked date in a javascript object.

2. Somehow we force a client side day render event.  Ideally this would work like "InvalidateRectangle" in a windowing system.  That is, a refresh (paint) event would be queued and would occur after the OnDateClick event finishes.

I'm assuming that if we just called raise_dayRender (see thread .../thread/b311D-bemtck.aspx) from the end of OnDateClick that wouldn't work because we're in the middle of the client side event lifecycle.  Is this true?

And as long as we're probably talking about futures, it would be nice if raise_dayRender was an official client-side API method (maybe called "refresh") and if we could refresh a single day.

Also, as long as we're making enhancement requests.  Would like to be able to use a MultiMonth calendar and have AutoPostback only occur on navigation events.  AutoPostback on date selection should be a separate option.

3. If we could force a client side day render event, then we can visually style the cell on the client according to the person and location information tucked away in the javascript object that we created in the OnDateClick event.

For our application and based on some of the other questions I see in the forum, we want to do as much on the client as possible.  The latency of a postback is problematic if it occurs on each date selection.

0
Missing User
answered on 28 Jul 2008, 11:00 AM
Hello Bob,


Unfortunately this is not possible in the current version of the RadCalendar control. I'll forward your request to our dev team for future consideration. Please keep sharing your feedback, as it will not remain overlooked. Our main goal is to continue improving our products and services and make them more attractive to clients. Your Telerik points have been updated

Kind regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Bob Pinna
Top achievements
Rank 1
Answers by
Bob Pinna
Top achievements
Rank 1
Missing User
Share this question
or