出于某种原因,我无法让我的 MVCContrib Grid 排序工作。
为什么以下代码会生成网格但没有可排序的列?
我正在使用 MVC3 和 Razor 语法。
@model List<InboundShipmentItem>
@using MvcContrib.UI.Grid
@Html.Grid(Model).Sort((GridSortOptions)ViewBag.SortOptions).Columns(column =>
{
column.For(item => !item.Verified ? Ajax.ActionLink("Receive", "ReceiveItem", new {id = @item.Id},
new AjaxOptions
{
HttpMethod = "GET",
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "grid",
OnSuccess = "InboundShipmentVerification.ReceiveItemSucceeded",
OnFailure = "InboundShipmentVerification.ReceiveItemFailed"
}).ToString() : "Received").Named("Received?").Encode(false);
column.For(item => item.PONumber).Named("PO#").Sortable(true);
column.For(item => item.ShipQty).Named("Qty Sent").Sortable(true).SortColumnName("Qty");
column.For(item => item.ReceivedQty).Named("Qty Recd");
column.For(item => item.ISBN).Named("ISBN");
column.For(item => item.Title).Named("Title");
column.For(item => item.Author).Named("Author");
column.For(item => item.InboundShipment.Status).Named("Shipment Status");
column.For(item => item.InboundShipment.ShipmentId).Named("Shipment #");
})