Hi Rexhxiao,
Please find the
following code snippet to render the Grid in JSON mode.
View:
@Html.Orubase().Grid<Standings>("grid")
.Datasource(Model).Caption("Foot Ball Team
Standings ")
.ActionMode(MobActionMode.JSON)
.Column(col =>
{
col.Add(c => c.Team).HeaderText("Team");
col.Add(c => c.Won).HeaderText("W");
col.Add(c => c.Loss).HeaderText("L");
col.Add(c => c.Percent).HeaderText("PCT");
col.Add(c => c.L10).HeaderText("L10");
})
In order to work
with paging and sorting actions, create a Post method for the respective
action and bind the data source to the grid as shown in the following
code.
Controller:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult
Index(MobGridParams args)
{
var data = StandingsDetails.GetData();
//
datasource
return data.MobGridJSONActions<Standings>(); // for Server Mode it will be
-> data.MobGridActions<Standings>();
}
Please let us know if you have any
queries.
Regards
Karthick
S P