I'm just getting around to trying out Kendo UI Web for the first time, and I've run into an error that I didn't expect, and can't see why it's coming up... I created a Kendo UI/MVC 4 project, added a couple Views to the Home controller and on the List View I added a Kendo Grid. When I run the page I get this error in the debugger:
Microsoft JScript runtime error: '$document' is undefined
What? Crazy, right? I have jquery.min.js correctly referenced in my _Layout.cshtml file, and confirmed it's loaded when the site runs. So where is this error coming from and how do I fix it? I am binding the grid to my model, which is an IEnumerable, and if I bind it to a table in the SAME VIEW, it works beautifully. So the data is good.
Here's the code I'm using in the View:
Any ideas? I'd love to get started using Kendo, if I can get past this initial issue...
Thanks!
Microsoft JScript runtime error: '$document' is undefined
What? Crazy, right? I have jquery.min.js correctly referenced in my _Layout.cshtml file, and confirmed it's loaded when the site runs. So where is this error coming from and how do I fix it? I am binding the grid to my model, which is an IEnumerable, and if I bind it to a table in the SAME VIEW, it works beautifully. So the data is good.
Here's the code I'm using in the View:
<div id="container"> <div id="grid"></div> <script> $document.ready(function() { $("#grid").kendoGrid({ id: "gridList", dataSource: model, schema: { model: { fields: { IncidentType: { type: "string" }, Location: { type: "string" }, WatchDateTime: { type: "date" }, PostDateTime: { type: "date" } } }, pageSize: 10 }, height: 600, scrollable: true, sortable: true, pageable: { input: true, numeric: false }, columns: [ { field: "IncidentType", title: "Incident Type", width: 300 }, { field: "Location", title: "Location", width: 100 }, { field: "WatchDateTime", title: "Incident Date", width: 100 }, { field: "PostDateTime", title: "Post Date", width: 100 } ] }); }); </script></div>Thanks!