@(Html.Kendo().Grid
.Name("JournalViewerGrid")
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20) @default to 10@
.ServerOperation(true) @default to true@
.Read(read => read.Action("GetJournals", "JournalEntryViewer"))
.Sort(sort => sort.Add(model => model.JournalEntryId).Descending())
.Model(model => model.Id(p => p.JournalEntryId))
)
)
Controller action:
public ActionResult GetJournals([DataSourceRequest] DataSourceRequest request)
{
return Json(db.vwAllJournalEntries.Select(je => new JournalEntryViewerViewModel
{
JournalEntryId = je.JournalEntryId,
LegalEntityId = je.LegalEntityId,
......
}).ToDataSourceResult(request));
}
No comments:
Post a Comment