Error in kendo javascript file

5 posts, 0 answers
  1. Leon
    Leon avatar
    10 posts
    Member since:
    Aug 2012

    Posted 03 Apr 2014 Link to this post

    I am working an application using Kendo Grid on an MVC application.  Starting at about 10:30 (central time) yesterday, the kendo grid software stopped working.  I am using IE 10 on a Windows 7 OS. The error is

    Unhandled exception at line 3, column 23238 in http://cdn.kendostatic.com/2014.1.318/js/jquery.min.js
    0x80020003 - JavaScript runtime error: Member not found.

    I am able to replicate the error in a simple application.  The View file contains the following definition for the grid

     

    @(Html.Kendo().Grid<MvcApplication1.Models.TestItem>()
      .Name( "testItemGrid" )
      .Columns( columns =>
      {
        columns.Command( command =>
        {
          command.Edit();
        } ).Width( 195 );
        columns.Bound( x => x.ItemId );
        columns.Bound( x => x.Name );
      } )
      .ToolBar( toolbar =>
      {
        toolbar.Create().Text( "Add New Item" );
      } )
      .Sortable()
      .Editable( editable => editable.Mode( GridEditMode.InLine ) )
      .DataSource( ds => ds
        .Ajax()
        .Model( m =>
                {
                  m.Id( x => x.ItemId );
                } )
         .Read( "TestItemRead", "TestItemGrid" )
         .Create( "TestItemCreate", "TestItemGrid" )
         .Update( "TestItemUpdate", "TestItemGrid" )
        )
      )

     

    The controller contains the following actions:
     

    public class TestItemGridController : Controller
    {
      public ActionResult Index()
      {
        return View();
      }
     
      public ActionResult TestItemRead( [DataSourceRequest] DataSourceRequest request )
      {
        List<Models.TestItem> items = new List<Models.TestItem>();
        items.Add( new Models.TestItem() { ItemId = 1, Name = "Item 1" } );
        items.Add( new Models.TestItem() { ItemId = 2, Name = "Item 2" } );
        items.Add( new Models.TestItem() { ItemId = 3, Name = "Item 3" } );
        items.Add( new Models.TestItem() { ItemId = 4, Name = "Item 4" } );
        items.Add( new Models.TestItem() { ItemId = 5, Name = "Item 5" } );
        return Json( items.ToDataSourceResult( request ) );
      }
     
      public ActionResult TestItemCreate( [DataSourceRequest] DataSourceRequest request, Models.TestItem testItem )
      {
        if( testItem != null && ModelState.IsValid )
        {
        }
        return Json( new[] { testItem }.ToDataSourceResult( request, ModelState ) );
      }
     
      public ActionResult TestItemUpdate( [DataSourceRequest] DataSourceRequest request, Models.TestItem testItem )
      {
        if( testItem != null && ModelState.IsValid )
        {
        }
        return Json( ModelState.ToDataSourceResult() );
      }
    }

     

    I have tried several things to fix the error:
    1. Update to latest version of Telerik software
     2. Use CDN support
     3. Use Local support

     I am at my wits end to resolve this issue.  Please help!

  2. Leon
    Leon avatar
    10 posts
    Member since:
    Aug 2012

    Posted 04 Apr 2014 in reply to Leon Link to this post

    I found that the Sortable() attribute is what's causing the grid to fail.  Don't know why, but when I comment it out on the grid, it started working again.  Need to determine why this is causing the problem because I need to be able to sort my grid columns.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Leon
    Leon avatar
    10 posts
    Member since:
    Aug 2012

    Posted 04 Apr 2014 Link to this post

    OK, I found the issue, but don't have a solution.  Turns out I somehow put the web site into compatibility mode.  When I cleared that compatibility setting, the kendo grids now work with the Sortable(). 

    Maybe you can fix this issue?
  5. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 07 Apr 2014 Link to this post

    Hello Leon,

    I would recommend specifying the DOCTYPE and the X-UA-Compatible meta tag. For example: 
    <!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">


    Regards,
    Alexander Popov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Leon
    Leon avatar
    10 posts
    Member since:
    Aug 2012

    Posted 07 Apr 2014 in reply to Alexander Popov Link to this post

    I put that meta tag in my _layouts.cshtml page and it appears to be working.  The DocType was already there.

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