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

DatePicker depends on JQuery version

5 Answers 121 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Sumana
Top achievements
Rank 1
Sumana asked on 26 Nov 2013, 11:21 PM
Hello,

Does Datepicker depends on JQuery version? I have both JQuery-1.8.2 and jQuery-2.0.3 in my Scripts folder. Please see below how it is referenced in BundleConfig.cs and _Layout.cshtml. However, the DatePicker does not show up and it's giving an error for the Date format. Please suggest.

BundleConfig.cs
bundles.Add(new ScriptBundle("~/bundles/site").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-ui-{version}.js",
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*",
"~/Scripts/site.js"
));

undles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));

bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
"~/Scripts/kendo/kendo.all.min.js",
"~/Scripts/kendo/kendo.aspnetmvc.min.js"));
bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
"~/Content/kendo/kendo.common.min.css",
"~/Content/kendo/kendo.default.min.css"));

_Layout.cshtml
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/kendo/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/kendo")

5 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 27 Nov 2013, 08:10 AM
Hi,

For some reason ASP.NET bundles don't include .min.js files in debug mode. I suspect this is why it doesn't work in your case - the kendo js files are never included. You can check the following help article for a solution: http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/asp-net-mvc-5#include-the-javascript-and-css-files


Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steve
Top achievements
Rank 1
answered on 05 Dec 2013, 05:15 PM



I followed the directions at http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/asp-net-mvc-5 explicitly, and things work until the end where I add a datepicker, then I get the error 'jQuery is undefined'. Brand new MVC5 project trying to add the latest Kendo UI bits.

Is there a fully-working downloadable sample available that can be used for comparison?


Thanks.
0
Atanas Korchev
Telerik team
answered on 06 Dec 2013, 08:06 AM
Hi,

You have probably missed this step:

7. Move the jQuery bundle in the head tag of the page. It is at the end of the page by default.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steve
Top achievements
Rank 1
answered on 06 Dec 2013, 04:36 PM
I did not miss that step. The direction for (7) is confusing. It says "move the jQuery bundle".... Move it where?

Since it was not clear, I added some extra newlines and then went to step 8, so the code looks like this:

...top of page code removed...
 
<div class="container body-content">
        @RenderBody()
        <hr />
        <footer>
            <p>© @DateTime.Now.Year - My ASP.NET Application</p>
        </footer>
    </div>
 
    @Scripts.Render( "~/bundles/jquery" )
    @Scripts.Render( "~/bundles/kendo" )
 
    @Scripts.Render("~/bundles/bootstrap")
    @RenderSection("scripts", required: false)
</body>
</html>
0
Steve
Top achievements
Rank 1
answered on 06 Dec 2013, 04:57 PM

I now see that I followed the directions a little too closely.

What says

7. Move the jQuery bundle in the head tag of the page. It is at the end of the page by default.

should say

7. Move the jQuery bundle *BEFORE THE CLOSING TAG OF </HEAD> AT THE TOP*  of the page. It is at the end of the page by default.
When I moved the Telerik code/refs within the <head>, the controls then render.
Tags
Date/Time Pickers
Asked by
Sumana
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Steve
Top achievements
Rank 1
Share this question
or