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

Disable months in year view

1 Answer 177 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Saranya
Top achievements
Rank 1
Saranya asked on 10 Sep 2014, 11:30 AM
Hi,

I need a month in the YEAR view to be visible but disabled. I.E I do not want to set the max date for the datepicker but want the month to have a CSS that shows it to be disabled (like background-color:lightgray)

This works nicely for MONTH view :

I tried with the below code but it did not work. Invalid template error.
Do we have any template for YEAR view to customize month display?

startpicker.setOptions({
     format: "MMMM, yyyy",
     value: startPickerValue.getMonth(),
     month: {
         content: "<div style='background-color:#= data.date < ($('#startDatePicker').data('kendoDatePicker').max()) >  ? 'cyan'  : 'lightgray' #'>#=data.value#</div>"
     }
 });



1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 10 Sep 2014, 02:55 PM
Hello Saranya,

Kendo UI Calendar provides templates only for the month view and templates for the other views are not supported. One possible way to control the rendered HTML is to wire the navigate method of the widget and find the corresponding table. Here is a simple Dojo demo, which shows how to do this.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Date/Time Pickers
Asked by
Saranya
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or