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

do that not all days were clickable?

4 Answers 87 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Michail
Top achievements
Rank 1
Michail asked on 02 Apr 2012, 06:29 PM

Hello, is that possible to do with kendo calendar that not all days were selectable for user?

something like on attached image (available days are underlined)

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 04 Apr 2012, 08:53 AM
Hello Michail,

 
Currently the required functionalty is not supported. I will suggest you, share your thoughts in our UserVoice. Thus other users, which want the same functionality, can vote for it.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joachim Karlsson
Top achievements
Rank 1
answered on 30 May 2012, 07:45 AM
I came up with an quick/easy solution for this.

Create ur own content template, here i got bookable times (newDateArray)
I set a class, if its in the bookable dates or not. (.bookable/.notbookable)

   $("#wheelshiftCalendar").kendoCalendar({
                    min: new Date(),
                    max: maxDate,
                    month: {
                        content: '# if ($.inArray(+data.date, [' + newDateArray + ']) !== -1) { #' +
                                            '<div class="bookable">#= data.value #</div>' +
                                     '# } else { #' +
                                            '<div class="notbookable" onclick="return false;">#= data.value #</div>' +
                                     '# } #'
                    },
                    change: function (e) {
                        if ($.inArray(+e.sender._value, newDateArray) !== -1) {
                            //bookable
                        }
                    }
        });

 //and then i finally
//k-link seems to be triggering the selectdate function
 $(".notbookable").parent().removeClass("k-link");
0
Josh
Top achievements
Rank 1
answered on 24 May 2013, 07:58 PM
@Joachim - i can't seem to remove the k-link parent.  Where do you put this
$(".notbookable").parent().removeClass("k-link");

in your code?  Since the date picker is generated dynamically, i'm not sure where this goes. 
0
Josh
Top achievements
Rank 1
answered on 24 May 2013, 08:47 PM
Never mind, i was able to do it like this (in the open() method):

                open: function(e) {
                  $(".k-weekend").each(function (){
                    console.info(this);
                    $(this).find("a").attr("disabled",true).removeClass("k-link").addClass("disabled-date");
                    $(this).removeClass("k-state-hover");
                  });
                }...

I'm trying to remove certain dates as well as all weekends.  However, clicking to the next month, that month isn't treated with this month template.  Moreover, clicking back to the original month removes the template application!  How does one get this "month" to "stick"?
Tags
Calendar
Asked by
Michail
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Joachim Karlsson
Top achievements
Rank 1
Josh
Top achievements
Rank 1
Share this question
or