Mouse multi selection

8 posts, 1 answers
  1. Daniel
    Daniel avatar
    11 posts
    Member since:
    Oct 2011

    Posted 11 Jun 2013 Link to this post

    Hello
    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 ..
       
  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 12 Jun 2013 Link to this post

    Hello Daniel,

    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. 

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Daniel
    Daniel avatar
    11 posts
    Member since:
    Oct 2011

    Posted 21 Jun 2013 Link to this post

    Ok , thank you for the input , I will change the design and not make a multi selection , I will have 2  Date Pikers and with the result the Control will load and display the interval from Database/Controller after . 
    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.




  5. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 24 Jun 2013 Link to this post

    Hi Daniel,

    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
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Daniel
    Daniel avatar
    11 posts
    Member since:
    Oct 2011

    Posted 27 Jun 2013 Link to this post

    Hello,
    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>    
            #}#

     
  7. Answer
    Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 27 Jun 2013 Link to this post

    Hello Daniel,

    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.

    Regards,
    Dimo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. CH
    CH avatar
    48 posts
    Member since:
    Aug 2010

    Posted 08 Jul 2014 Link to this post

    I hope the multi calendar can be like this:

    http://multidatespickr.sourceforge.net/
  9. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 08 Jul 2014 Link to this post

    Hello CH,

    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.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready