MVC with Easyui DataGrid paging
In the previous section, we talked about the use of the DataGrid to get data, which is a section of the DataGrid page.
The DataGrid will pass "current page number" "per page number"
The controller gets the parameters and gives the BLL layer processing logic and pagination, returning the total number of pages and the current page data
Finally to the DataGrid for processing
Extracurricular: From the front end of the processing speed I see, no previous Jqgrid control processing data quickly.
First, let the DataGrid support paging, we need to add a few attributes
Whether paging is enabled: pagination default is False
Quantity per page: pageSize default 10
Selectable per page: pagelist default [10,20,30,40,50]
Sort fields: Sortname default null
Sort type: SortOrder default ASC
OK after the join code becomes like this
$ (function () {$ (' #List '). DataGrid ({url: '/syssample/getlist ', Width: $ (window). Width ()
-Methord: ' Post ', Height: $ (window). Height ()-Fitcolumns:true, Sortname: ' id ', sortOrder: ' desc ', IDfield: ' id ', pagesize:15, PageList: [Pagination:true, MB, M], striped:true,//odd-even lines distinguish between singleselect:true,/
/Radio mode rownumbers:true,//line number columns: [[[{field: ' id ', title: ' Id ', width:80}, {field: ' Name ', title: ' Names ', width:120}, {field: ' Age ', Title: ' Ages ', width:80, align: ' Right '}, {field: ' Bir ', title: ' Birthdays ', width:80, align: ' right '}, {field: ' Photo ', tit Le: ' Photo ', width:250}, {field: ' Note ', Title: ' Description ', width:60, align: ' center '}, {Fiel D: ' Createtime ', title:' Creation time ', width:60, align: ' center '}]};
}); Index
Preview