开发者

Grails sort params

开发者 https://www.devze.com 2023-04-12 04:37 出处:网络
I am using ExtJS4 library to show a grid of paged data served by a Grails controller and returned开发者_运维技巧 as JSON.

I am using ExtJS4 library to show a grid of paged data served by a Grails controller and returned开发者_运维技巧 as JSON. One of the fields is a calculated field that I cannot pass back to the database for a query ... because it's calculated. What is a good solution to implement for this type of column sort request? Other columns I just pass back to the query through : list(params)


if you have a list, you can use this.

   def a = [5,3,4,2,1]
    //for asc
     a.sort{+it}
    //for des
     a.sort{-it}
0

精彩评论

暂无评论...
验证码 换一张
取 消