Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Implement Adding An Extra Parameter in Grails Pagination?

Tags:

grails

gsp

I have a page/gsp that displays 3 different classes.

This means that I need to add extra parameters to the pagination links.

currently the link auto generated by default pagination tag in grails produces links like this:

http://localhost:8080/Teams/Leader/assignFollower?offset=400&max=100

I'd like it to be something similar to this:

http://localhost:8080/Teams/Leader/assignFollower?LeaderId=1&TeamId=2&offset=400&max=100

Any ideas how I can implement this?

like image 548
Neoryder Avatar asked Mar 18 '10 08:03

Neoryder


1 Answers

The paginate tag accepts a params parameter. So something like:

<g:paginate
        total="${Leader.count()}"
        params="${[LeaderId:1, TeamId: 2]}" />

should do the trick.

See the docs for more: http://www.grails.org/GSP+Tag+-+paginate

Cheers!

like image 106
lunohodov Avatar answered Sep 20 '22 18:09

lunohodov