2

I have implemented a Kendo grid using Html helpers. Everything works but the sorting, when I click the sorting arrows, it thinks and refreshes the same data.

<div id="SearchResults">
            @{
                var grid = Html.Kendo().Grid<SearchCOESGridViewModel>();

                grid.Name("COESResultGrid")
                .Columns(columns =>
                {
                    columns.Bound(s => s.COESNo).Title(@SearchCOES.COESGridHeading);
                    columns.Bound(s => s.Postcode).Title(@SearchCOES.PostcodeGridHeading);
                    columns.Bound(s => s.AuditAuthNo).Title(@SearchCOES.AuditAuthGridHeading);
                    columns.Bound(s => s.COESNo).Title("").ClientTemplate("<a href='javascript:void(0)' data-id='#= COESNoValue #' class='edit-link'>" + @Grid.EditAction + "</a>").Sortable(false);

                });

                grid.DataSource(dataSource => dataSource
                    .Ajax()
                    .Sort(sort => sort.Add("COESNo").Ascending())
                    .Read(read => read.Action("SearchGridData", "PrepareCOES"))).AutoBind(false);


                grid.Pageable();
                grid.Sortable();

                @grid
            }
        </div>

How can I do sorting if I am using ajax data binding?

The paging works fine. Its just the sorting that doesn't seem to sort, I am using Chrome and I can see a request being sent back, but no sort happens

4

1 回答 1

1

没关系,我刚刚解决了。我没有包含 kendo.aspnetmvc.js 脚本。我有 kendo.web.js。但我两者都需要。现在工作正常。

于 2013-05-17T11:31:04.607 回答