newbie .kendoDatePicker is not a function

4 posts, 1 answers
  1. Ilyas
    Ilyas avatar
    3 posts
    Member since:
    Jun 2013

    Posted 20 Jun 2013 Link to this post

    hi,

    I test kendoui MVC razor, follow this way my test project

    _Layout.cshtml

       <script src="@Url.Content("~/Scripts/kendo/jquery.min.js")"></script>
        <script src="@Url.Content("~/Scripts/kendo/kendo.web.min.js")"></script>
        <script src="@Url.Content("~/Scripts/kendo/kendo.aspnetmvc.min.js")"></script>
        <script src="@Url.Content("~/Scripts/kendo/console.min.js")"></script>
        <script src="@Url.Content("~/Scripts/kendo/prettify.min.js")"></script>

    index.cshtml 

    @(Html.Kendo().DatePicker().Name("Birthday"))

    But have error on javascript 

    TypeError: jQuery(...).kendoDatePicker is not a function

  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 21 Jun 2013 Link to this post

    Hello Ilyas,

    The observed JS error can be caused by three things:

    1. The Kendo UI scripts are not registered successfully on the page
    2. The Kendo UI scripts are registered too late or the widgets' initialization statements are called too early
    3. There is a second jQuery instance registered on the page after the Kendo UI scripts

    I would suggest double-checking option (3) first. When using the Kendo UI MVC wrappers, option 2 is unlikely to occur.

    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. Ilyas
    Ilyas avatar
    3 posts
    Member since:
    Jun 2013

    Posted 21 Jun 2013 Link to this post

    hi, 

    thanks for reply... I check your to list but  do not skimp on.. I attached the firebug screenshot
  5. Answer
    Ilyas
    Ilyas avatar
    3 posts
    Member since:
    Jun 2013

    Posted 21 Jun 2013 Link to this post

    I find my problem :) 

    Problem is  default bundle code  line 

     exam 


    _Layout
    --------------- head tag ----------------------
         <script src="@Url.Content("~/Scripts/kendo/jquery.min.js")"></script>
        <script src="@Url.Content("~/Scripts/kendo/kendo.web.min.js")"></script>
        <script src="@Url.Content("~/Scripts/kendo/kendo.aspnetmvc.min.js")"></script>
    --------------------------------------

    --------------- body tag ----------------------
     @Scripts.Render("~/bundles/jquery")
       @RenderSection("scripts", required: false)
    --------------------------------------

    Update bundle or move the kendoui  script  under the render line :) 


    thanks 

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