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

newbie .kendoDatePicker is not a function

3 Answers 1929 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ilyas
Top achievements
Rank 1
Ilyas asked on 20 Jun 2013, 04:37 PM
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

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 21 Jun 2013, 08:29 AM
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!
0
Ilyas
Top achievements
Rank 1
answered on 21 Jun 2013, 03:06 PM
hi, 

thanks for reply... I check your to list but  do not skimp on.. I attached the firebug screenshot
0
Accepted
Ilyas
Top achievements
Rank 1
answered on 21 Jun 2013, 03:16 PM
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 

Tags
General Discussions
Asked by
Ilyas
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Ilyas
Top achievements
Rank 1
Share this question
or