tags:

views:

62

answers:

1

Hi,

is it possible to use the Grails "g:sortableColumn" tag to sort by a domain class "hasMany" property count?

class Book { hasMany = [authors: User]}

I want to sort all Books by the number of authors with a "g:sortableColumn" tag in my view, but how? Realy not possible?

Thanks and best regards...

A: 

not the best solution, but one

http://www.pubbs.net/200904/grails/65695-grails-user-sort-by-one-to-many-count-with-gorm-or-criteria.html

I thought there was a way to do it with criteriaBuilder but I cannot seem to make it work without changing your domain object

Aaron Saunders
Thanks a lot for your answer! But I hoped that there is a better way to do this in grails....
sysbeast