开发者

Grails sort params

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜