Hi Telerik team !
I'm trying to make the RadCalendar display the selected day despite of the date of today. This seems to be possible client side only.
You offers documentation on this way here but I'm not sure where I'm wrong.
Could you please give me and advise ? Is it possible to make the change server side ?
I obtain the message "Date out of range" whatever the use I make of this function. I'm also using SelectedDates even if I'm not in multi-date-select mode. The error is the same if I use a jQuery method to get the hidden value of the selected date field near the calendar.
Here's my code(s).
First try :
Second try :
ASCX
S.F.
I'm trying to make the RadCalendar display the selected day despite of the date of today. This seems to be possible client side only.
You offers documentation on this way here but I'm not sure where I'm wrong.
Could you please give me and advise ? Is it possible to make the change server side ?
I obtain the message "Date out of range" whatever the use I make of this function. I'm also using SelectedDates even if I'm not in multi-date-select mode. The error is the same if I use a jQuery method to get the hidden value of the selected date field near the calendar.
Here's my code(s).
First try :
| jQuery(document).ready(function(){ |
| var calendar = $find("<%= me.radCalSearch.ClientID %>"); |
| var dates = calendar.get_selectedDates(); |
| var date = new Date(dates[0]); |
| var dTriplet = [date.getYear(), date.getMonth()+1, date.getDate()]; |
| calendar.selectDate(dTriplet, true); |
| }); |
Second try :
| jQuery(document).ready(function(){ |
| var calendar = $find("<%= me.radCalSearch.ClientID %>"); |
| //var dates = calendar.get_selectedDates(); |
| var date = new Date(jQuery("input#dnn_ctr2445_SearchInput_radCalSearch_SD").attr('value')); |
| var dTriplet = [date.getYear(), date.getMonth()+1, date.getDate()]; |
| calendar.selectDate(dTriplet, true); |
| }); |
ASCX
| <telerik:radcalendar id="radCalSearch" runat="server" enablemultiselect="false" enablenavigationanimation="false" showrowheaders="false" UseColumnHeadersAsSelectors="false" UseRowHeadersAsSelectors="false" daynameformat="FirstTwoLetters" onselectionchanged="radCalSearch_SelectionChanged" AutoPostBack="true"> |
| <SpecialDays> |
| <telerik:RadCalendarDay Date="" Repeatable="Today"> |
| <ItemStyle CssClass="radCalToday_Default" /> |
| </telerik:RadCalendarDay> |
| </SpecialDays> |
| </telerik:radcalendar> |
S.F.
10 Answers, 1 is accepted
0
Hello Fichot,
I recommend you examine the following example which demonstrates the main client-side functions and see if it works for you:
Client-side API
I hope this helps
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I recommend you examine the following example which demonstrates the main client-side functions and see if it works for you:
Client-side API
I hope this helps
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sébastien
Top achievements
Rank 2
answered on 04 Nov 2009, 10:46 AM
Yes it helps a lot.
I come back with the following code :
get_selectedDates() already gives a triplet array, so it's shorter.
By the way, as I use the onselectionchanged="radCalSearch_SelectionChanged" with AutoPostBack="true", everytime the script select itself the previously selected date, it creates a PostBack. So it's an infinite loop... The date is already selected in fact, I just want the calendar to instinctly "navigate" to it.
Any ideas ?
I come back with the following code :
| jQuery(document).ready(function(){ |
| var calendar = $find("<%= me.radCalSearch.ClientID %>"); |
| var dates = calendar.get_selectedDates(); |
| calendar.selectDate(dates[0], true); |
| }); |
get_selectedDates() already gives a triplet array, so it's shorter.
By the way, as I use the onselectionchanged="radCalSearch_SelectionChanged" with AutoPostBack="true", everytime the script select itself the previously selected date, it creates a PostBack. So it's an infinite loop... The date is already selected in fact, I just want the calendar to instinctly "navigate" to it.
Any ideas ?
0
Sébastien
Top achievements
Rank 2
answered on 06 Nov 2009, 09:20 AM
Hi Telerik team,
Is there is a way to navigate on an already selected date without raising the OnDateSelectChanged event ?
S.F.
Is there is a way to navigate on an already selected date without raising the OnDateSelectChanged event ?
S.F.
0
Hello Fichot,
Unfortunately RadCalendar control does not support navigation through selected dates.
However, OnDateSelectChanged event is raised when AutoPostBack property of RadCalendar control is set to true.
Kind regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Unfortunately RadCalendar control does not support navigation through selected dates.
However, OnDateSelectChanged event is raised when AutoPostBack property of RadCalendar control is set to true.
Kind regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sébastien
Top achievements
Rank 2
answered on 06 Nov 2009, 03:48 PM
Hi Pavlina,
This is my idea, you're right.
My idea would be to distinct (client-side) the two senders, and filter the execution of the server side event OnDateSelectChanged.
We are moving all our apps to Q3, maybe this can help ?
Sébastien
This is my idea, you're right.
My idea would be to distinct (client-side) the two senders, and filter the execution of the server side event OnDateSelectChanged.
We are moving all our apps to Q3, maybe this can help ?
Sébastien
0
Hi Fichot,
I am not quite sure if I understand your scenario correctly. Could you please explain in more details what exactly you want to achieve?
Kind regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I am not quite sure if I understand your scenario correctly. Could you please explain in more details what exactly you want to achieve?
Kind regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sébastien
Top achievements
Rank 2
answered on 12 Nov 2009, 09:08 AM
Yes for sure Pavlina.
The calendar is used to select one date only, is AutoPostBack, and can select only one date at a time. In other words, the user click on a date, and it refreshes part of the page in order to display the events of this day.
But after clicking on a day which is not on the current month, the calendar displays the current month, and not the last day selected.
For example :
We are on November. I naviguate to December and click on day. A PostBack is produced, and the calendar displays November again.
Sébastien
The calendar is used to select one date only, is AutoPostBack, and can select only one date at a time. In other words, the user click on a date, and it refreshes part of the page in order to display the events of this day.
But after clicking on a day which is not on the current month, the calendar displays the current month, and not the last day selected.
For example :
We are on November. I naviguate to December and click on day. A PostBack is produced, and the calendar displays November again.
Sébastien
0
Hi Sébastien,
If your problem(s) persists, it will be best if you can send us a simple running project demonstrating the problem. Thus we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.
Looking forward for your reply.
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
If your problem(s) persists, it will be best if you can send us a simple running project demonstrating the problem. Thus we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.
Looking forward for your reply.
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sébastien
Top achievements
Rank 2
answered on 18 Nov 2009, 03:15 PM
When the client select a date, I would like this date to become the focused date after a PostBack. Have you already done this ?
0
Hello Sébastien,
I am sending you a simple working project which handles the desired functionality. Please give it a try and let me know if you need further assistance.
Additionally, could you please confirm that you are not resetting focused date?
Sincerely yours,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I am sending you a simple working project which handles the desired functionality. Please give it a try and let me know if you need further assistance.
Additionally, could you please confirm that you are not resetting focused date?
Sincerely yours,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.