DatePicker depends on JQuery version

6 posts, 1 answers
  1. Sumana
    Sumana avatar
    1 posts
    Member since:
    Oct 2013

    Posted 26 Nov 2013 Link to this post

    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")
  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 27 Nov 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Steve
    Steve avatar
    3 posts
    Member since:
    Oct 2010

    Posted 05 Dec 2013 Link to this post




    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.
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 06 Dec 2013 Link to this post

    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!
  6. Steve
    Steve avatar
    3 posts
    Member since:
    Oct 2010

    Posted 06 Dec 2013 Link to this post

    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>
  7. Steve
    Steve avatar
    3 posts
    Member since:
    Oct 2010

    Posted 06 Dec 2013 Link to this post


    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.
Back to Top
Kendo UI is VS 2017 Ready