Javascript errors with MVC - Object doesnt support this method or property

6 posts, 0 answers
  1. Nilesh
    Nilesh avatar
    1 posts
    Member since:
    Apr 2009

    Posted 24 Jul 2012 Link to this post

    I integrated the Kendo UI MVC controls with MVC 3 app, as mentioned in the link http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/introduction.

    but getting Javascript errors with MVC - Object doesnt support this method or property

    e.g.

    jQuery(function(){jQuery("#Grid").kendoGrid()

    here getting error "kendoGrid" Object doesnt support this method or property

    )here getting error " Object doesnt support this method or property
  2. H
    H avatar
    40 posts
    Member since:
    Jul 2010

    Posted 26 Jul 2012 Link to this post

    We are having the same problem.

    Can anyone help?

    We are on MVC 4, and were using the Q1 2012 release of the MVC tools.  

    We are trying to run that "side by side" with Kendo in our project.

    We get this error on IE 8, but not on Chrome or Firefox.

    We installed the Kendo Complete for MVC and are attempting to convert one of our grids to a Kendo grid to test out the functionality.

    I added these scripts to our .master file:
    <script type='text/javascript'  src="<%= Url.Content("~/Scripts/jquery.min.js") %>"></script>
    <script  type='text/javascript' src="<%= Url.Content("~/Scripts/kendo.web.min.js") %>"></script>
        <script  type='text/javascript' src="<%= Url.Content("~/Scripts/kendo.aspnetmvc.min.js") %>"></script>


        
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Ivan
    Ivan avatar
    1 posts
    Member since:
    Jul 2012

    Posted 01 Aug 2012 Link to this post

    We're getting the same error. We're using MVC4 as well and we're running the grid inside a Kendo Window when we get the Javascript error only in IE8. 
    If we pull the grid out of Kendo window, we do not get any Java script error in IE8. Everything works fine.

    Here's our razor code for the grid inside Kendo window.

    @(Html.Kendo().Window()
        .Name("categories_window")
        .Title("Select multiple items")
        .Content( @<text>
            @(Html.Kendo().Grid(Model)    
            .Name("grdCategory")
            .Columns(columns =>
            {
                columns.Bound(p => p.Code).Groupable(false);
                columns.Bound(p => p.Description);
            })
            .Groupable()
            .Pageable()
            .Sortable()
            .Scrollable()
            .Filterable()
            .DataSource(dataSource => dataSource
                .Ajax()
                .Read(read => read.Action("CategoriesRead", "PriceList"))
            )
        )
        </text>)
        .Draggable()
        .Visible(false)
        .Width(600)
        .Height(400)
        )
  5. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 01 Aug 2012 Link to this post

    We are having similar issues with Kendo window. I've had to resort to using partial views and doing things like:

    @(Html.Kendo().Window().Name("MyWindow")...Visible(false))

    And then read the content of your partial and initialize the window object similar to this:

    <script>
    $.ajax({
      type: 'POST',
      url: '@Url.Action("_GridPartial", "Controller")',
      data: 'id=1&arg1=abc&etc',
      sucess: function (response) {
        var wnd = $('#MyWindow').data('kendoWindow');
        wnd.content(response);
        wnd.center().open();
      },
      error: function (request, status, error) {
        // Handle error
      }
    });
    </script>
  6. David Beck
    David Beck avatar
    38 posts
    Member since:
    Jun 2010

    Posted 09 Aug 2012 Link to this post

    Hi Everyone,

    if this is a new MVC project please check the following as it took mean hours to find the solution.

    Sometimes Visual Studio when creating a new MVC Project places the following on the bottom of the _Layout
    @Scripts.Render("~/bundles/jquery")
    @RenderSection("scripts", required: false)

    Even though i manually declared this above it was causing the same error. Moved both lines to the end of the </head> tag and all is working beautifully.
  7. venkat
    venkat avatar
    1 posts
    Member since:
    Sep 2012

    Posted 20 Oct 2012 Link to this post

    Hello David Beck,

    Your answer worked well for me.

    Hopefully worked for all..

    Thanks,
    Venkat

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