easyui 排序实现

1.对easyui  datagrid 返回的数据,进行排序处理,便于搜索到我们的有用的信息。

    例如:

     

 2.datagrid 需要设置 sortable : true

     

{
                    field : 'crtTime',
                    title : '创建时间',
                    width : 100,
                    sortable :true,
                    align : 'center',
                    formatter : crtTimeFtt
                }, 

 3.F12 debug查看发送的请求信息

 4.截取部分控制器代码

/*
     * 
     */
    @RequestMapping(value="dabc/{aucId}",method = RequestMethod.GET, produces = { "application/json" })
    @ResponseBody
    public ListWithTotalCount<SettlementDealDto> sessssssQuery(@ModelAttribute("selectedAgency") SysAgencyDto selectedAgency,@PathVariable String aucId,String customerNo,String name,String account,String mobile,
            String certNo,String goodName,String brandNo, int page, int rows,String order, String sort){
        
        Pageable pageable;
        if (sort != null && !sort.isEmpty()) {
            pageable = new PageRequest(page - 1, rows, Direction.fromStringOrNull(order), sort);
        } else {
            pageable = new PageRequest(page - 1, rows);
        }

4.部分字段的排序需要做处理,无法直接使用 sortable:true 完成排序动作

原文地址:https://www.cnblogs.com/mr-wuxiansheng/p/6296726.html