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

Error on rending Grid

1 Answer 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jing
Top achievements
Rank 1
Jing asked on 05 Jun 2012, 09:47 PM
Hi, I am current replacing Telerik MVC extension with Kendo UI for MVC and having some issues with new Grid. I have a Grid as follow:

@{
    Html.Kendo().Grid(Model.Employees)
               .Name("EmployeeGrid")
               .Columns(columns =>
               {
                    columns.Bound(o => o.FirstName).Width(100).Title("First Name");
                     columns.Bound(o => o.LastName).Width(100).Title("Last Name");
                })
                 .Pageable()
                 .Render() ;               
}

I had an Error as Uncaught TypeError: undefined is not a function in kendo.web.min.js:8  and all control after this Grid stop working as well. Could you give me some ideas how to fix it? thanks

1 Answer, 1 is accepted

Sort by
0
Gregory
Top achievements
Rank 1
answered on 13 Jul 2012, 12:41 PM
Hello Jinq,

I have encountered the same message. The source of my problem was the .js files were not referenced in the correct order.
I have modified how my script bundle is built with the following:
// Kendo MVC
            bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
                "~/Scripts/kendo.web.js",
                "~/Scripts/kendo.aspnetmvc.js"));
Before that, my code was
// Kendo MVC
            bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
                "~/Scripts/kendo.*"));

It is important that kendo.web.js must referenced before kendo.aspnetmvc.js

Hope it helps.
Tags
Grid
Asked by
Jing
Top achievements
Rank 1
Answers by
Gregory
Top achievements
Rank 1
Share this question
or