I recently came into contact with the project, . I want to display the other field data of this business number in the datagrid of the current page, instead of all the data of all records. Now I use to show all the data first, and then write a query to display the data on the condition of the current business number, but it causes all the data to be displayed first when the page is loaded, and then to display the filtered data. If you look at the Internet, you should be able to datagrid directly to participate in loading the data you want. Please give us some advice. Here is the url, of the data loaded by datagrid
.the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
public ActionResult GetData (int page = 1, int rows = 10, string sort = "Id", string order = "asc", string filterRules = "")
{
var filters = JsonConvert.DeserializeObject<IEnumerable<filterRule>>(filterRules);
int totalCount = 0;
//int pagenum = offset / limit +1;
var customsinspection = _customsInspectionService.Query(new CustomsInspectionQuery().Withfilter(filters)).OrderBy(n=>n.OrderBy(sort,order)).SelectPage(page, rows, out totalCount);
var datarows = customsinspection.Select( n => new {
Id = n.Id,
Operation_ID = n.Operation_ID,
Flight_NO = n.Flight_NO,
Flight_Date_Want = n.Flight_Date_Want,
MBL = n.MBL,
Consign_Code_CK = n.Consign_Code_CK,
Book_Flat_Code = n.Book_Flat_Code,
Customs_Declaration = n.Customs_Declaration,
Num_BG = n.Num_BG,
Remarks_BG = n.Remarks_BG,
Customs_Broker_BG = n.Customs_Broker_BG,
Customs_Date_BG = n.Customs_Date_BG,
Pieces_TS = n.Pieces_TS,
Weight_TS = n.Weight_TS,
Volume_TS = n.Volume_TS,
Pieces_Fact = n.Pieces_Fact,
Weight_Fact = n.Weight_Fact,
Volume_Fact = n.Volume_Fact,
Pieces_BG = n.Pieces_BG,
Weight_BG = n.Weight_BG,
Volume_BG = n.Volume_BG,
IS_Checked_BG = n.IS_Checked_BG,
Check_QTY = n.Check_QTY,
Check_Date = n.Check_Date,
Fileupload = n.Fileupload,
Status = n.Status,
OperatingPoint = n.OperatingPoint}).ToList();
var pagelist = new { total = totalCount, rows = datarows };
return Json(pagelist, JsonRequestBehavior.AllowGet);
}