Calendar: Fixed selection, disappear if going past/future

6 posts, 1 answers
  1. Davide
    Davide avatar
    4 posts
    Member since:
    Sep 2013

    Posted 30 Dec 2013 Link to this post

    I've a trivial problem with calendar. Once the value is set, the user can't set any other value on the same view. The problem disappear if the user go to the future/past and come back.

    Here my implementation, it's quite simple

    I've a div with id calendar, on document ready:
                    <div id="calendar" style="display: none; width: 600px;"></div>

    <script>

        $(document).ready(function () {
            var d = DateStringISO2date($("#string_value").val());
            if (d == '') d = new Date();
    //d is a valid date, always

            $("#calendar").kendoCalendar({
                value: d,
                depth: "month"
            });

    ...

    //next

            function calendarSetValue(e)
            {
                var d = DateStringISO2date($("#string_value").val());
               if (d == '') d = new Date();

                var calendar = $("#calendar").data("kendoCalendar");
                calendar.value(d);
                //calendar.navigateDown(calendar.value()); I've tried to navigate to va
            }
            
        }

    Best regards,
    Davide
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 30 Dec 2013 Link to this post

    Hi Davide,

    I have tried to reproduce this problem, but to no avail. Would you please check this example and tell me what I missed?

    http://jsbin.com/iLepOYIX/1/edit

    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Davide
    Davide avatar
    4 posts
    Member since:
    Sep 2013

    Posted 30 Dec 2013 Link to this post

    Hi Kiril,

    the example is ok and it works on jsbin, but the same code on my implementation don't, the value is correctly set, but I can't select any other date.

    Maybe are theese differences of version and culture ore something else:
     
    <link href="@Url.Content("~/Content/kendo.compatibility.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2013.3.1119/kendo.common.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2013.3.1119/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2013.3.1119/kendo.uniform.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/2013.3.1119/kendo.dataviz.uniform.min.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/kendo/2013.3.1119/jquery.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2013.3.1119/kendo.all.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo/2013.3.1119/kendo.aspnetmvc.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
        <script src="@Url.Content("~/Scripts/js/cultures/kendo.culture.it-IT.min.js")"></script>
        <script>kendo.cultures("it-IT");</script>

    The calendar stay on a popup window, and there are many other controls that works fine except this only one.

    Yours example is correct, and thankyou, I only set first display none and after inline, tested on jsbin that works too.

    Regards,
    Davide

  5. Answer
    Davide
    Davide avatar
    4 posts
    Member since:
    Sep 2013

    Posted 31 Dec 2013 Link to this post

    After several attempts I've found the problem, It is the inline css value for display.

    I've changed it to block, and now it works fine.
    In my case I don't need now to place other tags next to it, and in the future I'll probably use another div as wrapper for workaround.

    Maybe a widget bug?

    Thank you and a happy new Year!
    ,
    by Davide 
  6. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 01 Jan 2014 Link to this post

    Hello Davide,

    Forcing inline display on elements, which normally behave as block elements is very likely to cause undesired side effects. Instead of making it with display inline we would suggest you to make it inline-block.

    Here is a demo:

    http://jsbin.com/EzAcoKo/4/edit


    Kind Regards,
    Petur Subev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  7. Davide
    Davide avatar
    4 posts
    Member since:
    Sep 2013

    Posted 01 Jan 2014 Link to this post

    Ok thank you.

    Best Regards,
    by Davide
Back to Top
Kendo UI is VS 2017 Ready