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

[Solved] Next/Previous Month events

4 Answers 109 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
nachid
Top achievements
Rank 1
nachid asked on 03 Nov 2010, 09:38 PM
I am displaying a calendar inside a tabstrip and making taking the full space there
with a small jQuery code I am changing the display
I am showing the full dayname and making things different
Here is my code
$('.t-calendar th').css('width', '200px').css('height', '50px').css("text-align", "center")
$('.t-calendar td').css('height', '70px').css("text-align", "center")
 
$('.t-calendar th').each(function (index)
{
    $(this).text($(this).attr('title'));
});
This works perfectly and fulfills exactly my needs

However all my efforts are ruined when somebody hits next or previous month buttons.
Apparently the Calendar is rendered again and my settings are lost.

Is there a way I can trap the next/previous month events

4 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 04 Nov 2010, 10:37 AM
Hello nachid,

Unfortunately next previous and month buttons don't rise events. Workaround for your case is to hooking up to client 'click' event on this buttons and then you can apply all css rules.

All the best,
Hristo Germanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
nachid
Top achievements
Rank 1
answered on 04 Nov 2010, 11:54 AM
Hi Hristo
Thank you for your answer
I was investigating the telerik.calendar.js file and found that a navigate event is triggered whenever you move the header of the calendar.
$t.trigger(this.element, 'navigate', { direction: xxxxx});

I was wondering is there is a way to trap this event and hook something there


0
Accepted
Hristo Germanov
Telerik team
answered on 04 Nov 2010, 02:51 PM
Hi nachid,

Yes, you can try to achieve your goal with navigate event, but I notice that if you click on 't-other-month' days, navigate event will not triggered(my solution will not help too). In this case I suggest you to stop client 'click' on 't-other-month' days.

Best wishes,
Hristo Germanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
nachid
Top achievements
Rank 1
answered on 04 Nov 2010, 06:06 PM
Thank you Hristo
I went finally with your solution
I hope having onNavigate hook in one of the next releases

Calendar is really the poor relation of the library....
Tags
Calendar
Asked by
nachid
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
nachid
Top achievements
Rank 1
Share this question
or