Reading directory
- Use Remote Data
- Use Remote Data Sorting
- Use Remote Data Paging
Use Remote Data
Ligergrid allows you to specify a URL to load data, and supports sorting and paging. There are certain restrictions on the data format, such
{
"Rows ":[], "Total ":0
}
We need to put the data to be displayed in rows (in the form of an array) and put the number of records in total
The names of rows and total fields are not fixed. You can modify the parameters:
Root: 'rows ', // Data Source Field name
Record: 'Total', // data source record number field name
Use Remote Data Sorting
When sorting data is loaded for the first time, the system determines whether the sortname parameter is set. If so, the system will transmit the sorting information to the server:
String sortname = context. request ["sortname"];
String sortorder = context. request ["sortorder"];
When we click the header, it is also possible to trigger the server sorting operation:
We usually specify the default sorting field, such as sortname: 'orderid ':
The parameter names of sortname and sortorder can be changed:
Use Remote Data Paging
Liger grid comes with pagination. If local data is used, pagination is unnecessary. However, if remote data loading is used, you need to perform this paging operation on your own, return the corresponding data based on the paging information.
The component transmits several useful paging parameters to the server:
The server performs paging based on these two parameters:
String _ pagenumber=Context. Request["Page"];
String _ pagesize=Context. Request["Pagesize"];
We need to return a string in JSON format:
If you have any questions, refer:
Jquery ligerui table ligergrid combines ASP. net mvc to display data
Jquery liger UI ligergrid creates a general paging sorting query table (for download)
Or go to the Forum to ask:
Http://bbs.ligerui.com