1

剣道ポップアップ ウィンドウで剣道グリッドを起動しようとしていますが、グリッドが表示される代わりに、json データを取得しています。

ここに画像の説明を入力

これは私のコントローラからのコードです:

[HttpGet]
    public ActionResult Read([DataSourceRequest]DataSourceRequest request, int id)
    {
        var model = Service.FindOne("Cashflows", x => x.Id == id);
        var cashflows = new List<flows>();

        foreach (var cf in model.CashFlows)
        {
            var flow = new flows
            {
                Id = cf.Id,
                AssetId = cf.Id,
                MortgageValue = cf.MortgageValue,
                Year = cf.Year
            };
            cashflows.Add(flow);
        }

        var result = cashflows.ToDataSourceResult(request);

        return Json(result, JsonRequestBehavior.AllowGet);
    }

これは私の剣道ビューにあるものです。

@(Html.Kendo().Grid<ViewModels.Finance.flows>()
.Name("Grid")
.Columns(columns =>
{
    columns.Bound(p => p.Id);
    columns.Bound(p => p.AssetId);
    columns.Bound(p => p.Year);
    columns.Bound(p => p.MortgageValue);
})
.DataSource(dataSource => dataSource
    .Ajax()
    .Read(read => read.Action("Read", "Finance"))
    .ServerOperation(false)
    .PageSize(5)
)
.Pageable()
)
4

1 に答える 1

3

You need to update the return command to:

return Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
于 2013-01-29T14:21:08.803 に答える