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

[Solved] Cancel Change to Calendar

2 Answers 41 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.
Brian Lehmann
Top achievements
Rank 2
Brian Lehmann asked on 07 Jun 2011, 05:11 PM
Is there any way to cancel a change to the Calendar. Specifically, I'm capturing the OnChange event and running some business validation logic. If that validation fails, I'd like to prevent the change from occurring. I've tried setting the Calendar's value to the e.previousDate value in the event handler, but that seems to be ignored.

Is this supported and I'm just missing it?

Thanks in advance!
brian

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 08 Jun 2011, 07:07 AM
Hi Brian,

Please use a timeout before selecting the previous date:

function onChange(e) {
 
    var cal = $(this).data("tCalendar");
    var d = e.previousDate;
 
    // if ()
    window.setTimeout(function(){ cal.value(d); }, 1);
}


Regards,
Dimo
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
Brian Lehmann
Top achievements
Rank 2
answered on 08 Jun 2011, 03:35 PM
Works great! Thanks for the swift reply!

brian
Tags
Calendar
Asked by
Brian Lehmann
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Brian Lehmann
Top achievements
Rank 2
Share this question
or