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

Calendar: Fixed selection, disappear if going past/future

5 Answers 76 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Davide
Top achievements
Rank 2
Davide asked on 30 Dec 2013, 10:40 AM
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

5 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 30 Dec 2013, 11:31 AM
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!
0
Davide
Top achievements
Rank 2
answered on 30 Dec 2013, 03:21 PM
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

0
Accepted
Davide
Top achievements
Rank 2
answered on 31 Dec 2013, 12:45 PM
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 
0
Petur Subev
Telerik team
answered on 01 Jan 2014, 09:28 AM
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!
0
Davide
Top achievements
Rank 2
answered on 01 Jan 2014, 12:27 PM
Ok thank you.

Best Regards,
by Davide
Tags
Calendar
Asked by
Davide
Top achievements
Rank 2
Answers by
Kiril Nikolov
Telerik team
Davide
Top achievements
Rank 2
Petur Subev
Telerik team
Share this question
or