문제

There are a lot of possibilities to make pagination with domain classes, but what about existing ArrayList of objects?

Is it possible?

도움이 되었습니까?

해결책

Couldn't you use the standard Grails paginate tag, but in place of:

    [books: Book.list(params), bookCount: Book.count()]

Do something like:

    [books:list.drop(params.int('offset')?:0).take(params.int('max')?:10),
     bookCount: list.size()]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top