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

grid not working properly in mvc 4 vs2012

4 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Missing User
Missing User asked on 21 Jan 2013, 07:48 PM
Hello,

I m using VS2012 and I m working on a MVC 4 project with the trial version of Kendo.I've managed to implement a simple grid and got some basic functionality.
My controller has these 2 methods

private static IEnumerable<MemberViewModel> GetMembers()
      {
          var context = new EntityContext();
          return context.Members.Select(mem => new MemberViewModel
          {
              MemberId=mem.MemberId,
              Name=mem.FirstName,
              SurName = mem.LastName
           
          });
          
        
      }

public ActionResult Members_Read([DataSourceRequest] DataSourceRequest request)
       {
           return Json(GetMembers().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
       }
And in my view i have this header

<header>

    <link href="~/Styles/kendo.common.min.css" rel="stylesheet" />
    <link href="~/Styles/kendo.default.min.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.9.0.min.js"></script>
    <script src="~/Scripts/kendo.all.min.js"></script>
    <script src="~/Scripts/kendo.aspnetmvc.min.js"></script>

</header>
and the grid code is 
(Html.Kendo().Grid(Model)
      .Name("Grid")
      .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .ServerOperation(false)
                                    .Read(read => read.Action("Members_Read", "Home").Type(HttpVerbs.Get)))
                                     
                                     .Pageable()
                                     .Selectable()
                                     .Sortable()
 
      )
As i said grid is showing the results and pagination.But a)Selectable does not work neither in Chrome-Firefox
 b)Sortable is always giving me a json result from server side.I cannot enable client sorting besides i wrote my code exactly the same
as kendo mvc examples. c)ServerOperation(false) still does not disables server side sorting.d)I ve added to web.config this line
 <modules runAllManagedModulesForAllRequests="true" />  but again no client side sorting.

Any ideas on what is wrong with the above?
Thanx in advance

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 22 Jan 2013, 07:48 AM
Hello,

 Kendo UI doesn't currently support jQuery 1.9. More info can be found here.

Kind regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Missing User
answered on 22 Jan 2013, 08:07 AM
Thank you for your answer!
But I ve already tried a lot of different versions of jquery.No improvement.
0
Atanas Korchev
Telerik team
answered on 22 Jan 2013, 08:23 AM
Hi George,

Can you confirm that you tried with jQuery 1.8.2 and the problem persists? I think there is some sort of JavaScript error which prevents the JavaScript from executing properly. The troubleshooting help topic may be of help.

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Missing User
answered on 22 Jan 2013, 08:54 AM
The problem was that jquery was included twice,as mvc used jquery bundle at the end of the page.
Thank you very much for your answer.It saved me a lot of time!
Tags
Grid
Asked by
Missing User
Answers by
Atanas Korchev
Telerik team
Missing User
Share this question
or