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
0
Hello Michail,
Georgi Krustev
the Telerik team
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.
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");
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
in your code? Since the date picker is generated dynamically, i'm not sure where this goes.
$(
".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):
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"?
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"?