0

json 结果只是显示在屏幕上,而不是填充网格。

public ActionResult BulkEdit([DataSourceRequest]DataSourceRequest request)
{        
    var NewAssets = db.TurnaroundDumps;
    DataSourceResult result = NewAssets.ToDataSourceResult(request)
    return Json(result, JsonRequestBehavior.AllowGet);
}

 然后在我看来:

@(Html.Kendo().Grid<PcInventory_v1_1.Models.TurnaroundDump>()
.Name("Grid")
.Columns(columns =>
{
    columns.Bound(p => p.AssetTag);
    columns.Bound(p => p.SerialNumber);
    columns.Bound(p => p.DeptId);
    columns.Bound(p => p.Location);
})
    .DataSource(dataSource => dataSource
        .Ajax() // Specify that the data source is of ajax type
        .Read(read => read.Action("BulkEdit", "Assets")) 
        // Specify the action method and controller name
    ).Pageable()
)

出了什么问题?

4

1 回答 1

0

我忘了返回视图。

这是答案:

 public ActionResult BulkEdit()
    {
        return View();
    }

    [HttpPost]
    public ActionResult BulkEdit([DataSourceRequest]DataSourceRequest request)
    {
        var emp = db.TurnaroundDumps;


        DataSourceResult result = emp.ToDataSourceResult(request);


        return Json(result, JsonRequestBehavior.AllowGet);
    }
于 2012-11-19T16:41:21.977 回答