I need to make a mouse multi date selection over the calendar and in best case over more then one calendar .
It must be possible to do something like the image : http://img19.imageshack.us/img19/4718/calendarsp.png
It must be done in one selection by mouse.
1.I now it is not at the moment implemented in calendar , but is there a way to do it using the Drag-Drop functionality by example ..
2.Are there any plans for a multi selection in calendar?
3.How do I remove the functionality of the header ? I don't want to be possible to change the month and year and not by "prevent default" to the events ...
4.Is there a more interesting way to select the month ..currently I use the .Value(DateTime.Parse("01-01-2013")) to show Jan month. Need something like ShowMonth("jan") or so , because setting the value place the sellection mark on the specific day , I just need a month displayed with no possibility to change it ..
7 Answers, 1 is accepted
I am afraid the described multiple selection behavior cannot be achieved, because the Calendar can only have one date as a selected value.
Currently we have no definite intentions to introduce multiple selection. This may change in the future, depending on customer feedback and feature requests.
With regard to navigation prevention, you can use the Min() and Max() properties to limit the viewable months to a specific one:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/calendar/overview
This will also resolve your question about displaying a particualr month with no specific set value.
Dimo
Telerik
I have 2 more question :
1. I got the demo with the "MonthTemplate" , it is nice , I need somethis similar ,but I want to know if it is possible to add in the MonthTemplate data from Controller , or page Model .
The scenario : on a year calendar (12 normal calendars) you have with different styles:
- State free days
- Company free days
- Sick Vacation days
-Normal Vacation days
for a specific user selected at that time .
2. Min() and Max() do the job great , thank you , but how do I disable the navigation when the user clicks on the title "June 2013" of the month calendar.
The MonthTemplate can be an HTML string or a Kendo UI client template. This does not prevent you from generating the MonthTemplate in the controller, according to some server-side logic and then pass it to the view. However, please keep in mind that the Calendar month navigation is client-side, so the MonthTemplate cannot be recreated on the server when the user changes the month.
You can disable title navigation with
$(document).ready(
function
(){
$(
"CalendarID .k-nav-fast"
).off(
"click"
).css(
"cursor"
,
"default"
);
$(
"#CalendarID .k-nav-fast"
).on(
"click"
,
false
);
});
The above script must be included after the Calendar declaration.
Regards,
Dimo
Telerik
I found a problem with the Template Creation .
I done something similar with what is in the demo section of the calendar only with the array of dates got back from Model :
# var nameList = @Html.Raw(newSystem.Web.Script.Serialization.JavaScriptSerializer().Serialize(Model.OfficialHolidays));
var dateArray = new Array();
var iterator = 0;
while(nameList[iterator] != null)
{
var date = parseInt(nameList[iterator].substr(6));
dateArray[iterator] = date;
iterator++;
}#
http://img51.imageshack.us/img51/8401/2g6j.png
My problem is that the value of "data.date" it is all the time the same , while the actual data.dateString changes .
The solution is to make a new Date out of the dateString
# var dataStr = data.dateString;var dateD = new Date(dataStr);debugger; if($.inArray(dateD.valueOf(), dateArray) != -1)
{
#
<div class="party">#= data.value #</div>
#}#
The MonthTemplate is evaluated for each date cell. Based on the provided code snippet, it seems that you are building the same date array multiple times, which is not needed.
>> How do I check if a date is in my array of dates
This is demonstrated in the Calendar Templates offline example, which is shipped together with Kendo UI MVC.
Currently I am not sure the described problem is related to Kendo UI. If you believe otherwise, please provide a runnable demo.
Dimo
Telerik
http://multidatespickr.sourceforge.net/
If you have any specific feature requests, please submit and/or vote for them here:
http://kendoui-feedback.telerik.com/
Regards,
Dimo
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.