Construction of ASP.net mvc4+ef5+easyui+unity2.x injection background Management system (8)

Source: Internet
Author: User
Tags sort

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.