Hello,
ive enabled paging on my Grid, but he still showing all Entries on one Site. On the footer of the grid i see the Pages and the text: 1 of 9 pages (99 items). But all items are displayed on the first page! If i click through the Pages, nothing happens:
@(Html.EJ().Grid<object>("MitarbeiterGrid")
.Datasource(ds=>ds.URL("Mitarbeiter2/LoadData").CrudURL("Mitarbeiter2/CrudUpdate").Adaptor(AdaptorType.UrlAdaptor)).AllowPaging()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Normal); })
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Delete);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
});
})
.Columns(col =>
{
col.Field("Id").Visible(false).IsPrimaryKey(true).Add();
col.Field("Personalnummer").Add();
col.Field("Vorname").Add();
col.Field("Nachname").Add();
col.Field("Email").Add();
col.Field("Status").ForeignKeyField("wert").ForeignKeyValue("anzeige").DataSource((IEnumerable<object>)ViewBag.datasource1).Add();
col.Field("MitarbeiterTyp_Id").HeaderText("Mitarbeitertyp").ForeignKeyField("Id").ForeignKeyValue("Typname").DataSource((IEnumerable<object>)ViewBag.datasource).Add();
})
)
----------------------------------------------------------------
Controller:
public JsonResult LoadData()
{
ModelContext cont = new ModelContext();
//cont.Configuration.LazyLoadingEnabled = false;
var data = cont.Mitarbeiter.Include("MitarbeiterTyp").ToList();
return Json(new {result= data, count = data.Count }, JsonRequestBehavior.AllowGet);
}
THanks