This question is locked. New answers and comments are not allowed.
Hi,
I've a DatePicker like this
@(Html.Telerik().DatePickerFor(m => m.dip_Data)
I need to view only year/month combination while navigating.
I set Year as default view in OnOpen event:
and everything works fine.
Now I would like to intercept in any possible way the event "OnNavigate", so I can force navigateVertically to return to month view if someone try to go to day view. Obviously this is an horrible solution...
I didn't find any "OnNavigate" event and no event seems to be fired during navigation.
Any help about this?
Thanks
K.
I've a DatePicker like this
@(Html.Telerik().DatePickerFor(m => m.dip_Data)
.Name("MyDate")
.HtmlAttributes(new { id = "DateTime_wrapper", style = "position: relative; width: 200px;" })
.Format("MMM yyyy")
.ClientEvents(events => events.OnOpen("Picker1_Open").OnChange("Picker1_Change"))
)
I need to view only year/month combination while navigating.
I set Year as default view in OnOpen event:
function Picker1_Open(e) { e.preventDefault(); e.stopPropagation(); var picker = $(this).data("tDatePicker"); var calendar = picker.dateView._getCalendar(); picker.open(); if (!this.value) { var myDate = new Date(); myDate = new Date(myDate.getFullYear(), myDate.getMonth(), 1) var stopAnimBU = calendar.stopAnimation; calendar.stopAnimation = true; calendar.navigateVertically(2, myDate, false); calendar.stopAnimation = stopAnimBU; }and everything works fine.
Now I would like to intercept in any possible way the event "OnNavigate", so I can force navigateVertically to return to month view if someone try to go to day view. Obviously this is an horrible solution...
I didn't find any "OnNavigate" event and no event seems to be fired during navigation.
Any help about this?
Thanks
K.