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

Error on load...

11 Answers 710 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 13 Jul 2012, 06:52 PM
I'm getting error: Microsoft JScript runtime error: Object doesn't support property or method 'kendoGrid'

Grid:
@(Html.Kendo().Grid(Model)
        .Name("CodeManager")   
    .Columns(columns =>
    {       
        columns.Bound(p => p.CodeID);
        columns.Bound(p => p.Status);       
    })   
    .DataSource(dataSource => dataSource   
        .Ajax()        
        .Read(read => read.Action("_Filtering", "CodeManager"))
    ))

11 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Dyankova
Telerik team
answered on 16 Jul 2012, 12:55 PM
Hello Dennis,

The code snippet you provided looks OK, but I am afraid it is not sufficient enough to determine where the problem comes from. The issue might be related with the lack of some resources in your project - please make sure the needed scripts are loaded. If this is not the case I will need a small but runnable project - this way I will be able to observe the problem and advice you further.
 
Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Rick
Top achievements
Rank 2
answered on 06 Aug 2012, 05:37 AM
I'm not the same person who posted the original thread, but I am having the exact same problem.

The attached project gives the error "Microsoft JScript runtime error: Object doesn't support property or method 'kendoGrid'" when run. I believe the project contains all of the needed scripts. I am using jquery version 1.7.2 instead of 1.6.2 which is installed by default with the MVC4 platform.

I know that 1.7.2 works with kendoUI because I'm using it on my real project. This test project is an attempt to build a small project that I can use to demonstrate another problem I am running into with the kendoui grid. On my real project, I actually ran into this same error a week or two ago, but I managed to get past it. As I recall, the problem was that I had more than a single instance of jquery in my project. However, I'm pretty sure I only have one instance of jquery in this test project and I'm still getting the error.

It took a bit of work to get the attached zip file down under 2MB so I could upload it (2MB is the max allowed size). I had to remove most of the data from the packages folder. You shouldn't need this data as it's standard MVC 4 install stuff anyway, but if you do, let me know. It's frustrating that you have an upload limit of 2MB when a standard, default MVC4 project with nothing but KendoUI added to it comes to about 5MB zipped. When working with Telerik support, it is common for them to need a simple project to demonstrate the problem; is there a recommended subset of the project that you expect us to send?
0
Nikolay Rusev
Telerik team
answered on 06 Aug 2012, 06:56 AM
Hello Rick,

The answer to your question will be posted in other forum thread.

Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dennis
Top achievements
Rank 1
answered on 06 Aug 2012, 03:43 PM
Something you need to consider is that the order in which you have your javascript files referenced does matter. I finally worked out all my "problems". let me know if I can be of any assistance.
Thanks
Dennis
0
Rick
Top achievements
Rank 2
answered on 06 Aug 2012, 09:36 PM
Thanks, I appreciate it.

I have verified that the order of my javascript files is the same in both my real project (which does not have a problem with the kendoui grid) and my test project (which does). This did not solve the problem.

The only other javascript differences are that
    (1) my test project has an additional file called AjaxLogin.js which my real project doesn't have - I didn't add that file myself, but  I'm guessing it's part of the default MVC Internet Application (which is how I set up my test project as opposed to an Intranet project like my real one) and  
    (2) My real application also has some telerik.*.min.js files (because I am still using a couple of the older Telerik non-kendo controls).

I doubt either of these things is causing the problem.

I remember that I went through this problem with kendoui.grid on my real project too, but after removing the older version of jquery the problems went away. I may have done something else, but if so, I don't recall what it was.

    Rick.
0
Dennis
Top achievements
Rank 1
answered on 06 Aug 2012, 09:42 PM
Here is how I have my .js files.

<link href="@Url.Content("~/Content/kendo/kendo.common.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/kendo.default.min.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/kendo/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />


    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-1.7.2.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.2.710/kendo.web.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.2.710/kendo.dataviz.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.2.710/kendo.aspnetmvc.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.2.710/kendo.grid.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.2.710/kendo.menu.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/kendo/2012.2.710/kendo.dropdownlist.min.js")" type="text/javascript"></script>

I'll also try to remember any other fixes I had to go through. I should have wrote all this stuff down.

Thanks
Dennis
0
Rick
Top achievements
Rank 2
answered on 06 Aug 2012, 09:56 PM
Where do you do this?

In Visual Studio, the references are listed alphabetically and it's not possible to change the order.

Rick.
0
Dennis
Top achievements
Rank 1
answered on 06 Aug 2012, 10:00 PM
Are you using MVC? If so, I put it in the _Layout.cshtml under Views/Shared. Doing this will prevent you from having to reference these files in every view.

Thanks
Dennis
0
Rick
Top achievements
Rank 2
answered on 06 Aug 2012, 10:17 PM

Oh, right. Duh.

I missed adding a reference or two in there, which is what was causing the problem.

I changed my _Layout.cshtml to look like this and the grid is working now.

<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="@Url.Content("~/Content/kendo.common.min.css")" />
<link rel="stylesheet" href="@Url.Content("~/Content/kendo.default.min.css")" />
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kendo.web.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kendo.aspnetmvc.min.js")" type="text/javascript"></script>

Thanks for your help!

Rick.
0
Dennis
Top achievements
Rank 1
answered on 06 Aug 2012, 10:25 PM
Nice! Keep me posted on how things are going.

Thanks
Dennis
0
Daniel Mitchell
Top achievements
Rank 1
answered on 31 Mar 2014, 03:58 AM
Hi I have just taken over a project using Kedo so I am a bit of a newbie..

I'm getting a very similar issue:

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'kendoMenu'

This only occurs in IE though, it works fine in chrome..

Tags
Grid
Asked by
Dennis
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Rick
Top achievements
Rank 2
Nikolay Rusev
Telerik team
Dennis
Top achievements
Rank 1
Daniel Mitchell
Top achievements
Rank 1
Share this question
or