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}
精彩评论