I am developing a server side grid page ,i have googled it and did not find the correct behavior for me,
I need to each page size change dynamically and also the total number be set not via result len because i want to show user that we have for example 10000 pages but each time send him only 100 when i do so if my page size is 100
.DataSource(dataSource => dataSource
.Custom()
.Type("aspnetmvc-ajax")
.ServerPaging(true)
.ServerSorting(true)
.ServerFiltering(true)
.Transport(transport => transport
.Read(read => read.Action("GetTodaysSalesList", "Sales")
.Data("filterData"))
)
.Schema(schema => schema.Model(model =>
{
model.Id(p => p.RowID);
model.Field(p => p.InvestorID).Editable(true);
model.Field(p => p.LoanNumber).Editable(false);
model.Field(p => p.LoanStatus).Editable(false);
model.Field(p => p.LoanCategory).Editable(false);
model.Field(p => p.CRBFundedDate).Editable(false);
model.Field(p => p.NoteDate).Editable(false);
model.Field(p => p.LoanAmount).Editable(false);
model.Field(p => p.NetFunding).Editable(false);
model.Field(p => p.Rate).Editable(false);
model.Field(p => p.XIRR).Editable(false);
model.Field(p => p.DateOfSale).Editable(false);
model.Field(p => p.DaysOutstanding).Editable(false);
model.Field(p => p.AccruedInterest).Editable(false);
model.Field(p => p.CRBOriginationFee).Editable(false);
model.Field(p => p.ImputedInterest).Editable(false);
model.Field(p => p.Platform).Editable(false);
}).Data("Data").Total("Total"))
this controller side i have tried some options
option one:
var test = _loans.ToDataSourceResult(request);
test.Total = 1000;
return Json(test, JsonRequestBehavior.AllowGet);
option two
return Json( new {Data=loans.ToDataSourceResult(request) Total=10}, JsonRequestBehavior.AllowGet);
the total has no influnce