EasyUI ComboGrid paging, easyuicombogrid
I. Application scenarios
The drop-down box allows you to easily select a value without manual input. In EasyUI, ComboGrid corresponds to it. ComboGrid can be used in both the drop-down box and search to display data that matches the currently entered characters.
We generally use ComboGrid in two ways. One is to get the data first, bring it to the page, and then perform rendering when the page is loaded; the other is to request the background service through ajax to obtain json data after the page is loaded, then perform rendering. These two methods can be used in common applications, and there are no other problems. However, when the data volume is large, neither of these methods can meet our needs. For example, when the data volume reaches 100,000 or several hundred thousand, the loading time of the page will obviously become longer, or even become stuck. In this case, we can use ComboGrid to display data by page.
Ii. Example
The html code is as follows:
1 <! DOCTYPE html> 2
The background controller is as follows:
/*** Return the person list data with json data * @ param page Current page number * @ param pagesize page size * @ param keyword the keyword to be searched * @ return json data */@ requestMapping (value = "person ") @ ResponseBody public Map <String, Object> getPersons (@ RequestParam ("page") int page, @ RequestParam ("pagesize") int pagesize, @ RequestParam (value = "keyword ", required = false) String keyword) {Map <String, Object> result = new HashMap <String, Object> (); int total = personService. countPageByName (kind, keyword); List <Person> productList = personService. queryPageByName (keyword, pagesize, page); result. put ("total", total); result. put ("rows", productList); result. put ("_ pagelines", pagesize); result. put ("_ currpage", page); return result ;}