How To Implement Adding An Extra Parameter in Grails Pagination?
I have a page/gsp that displays 3 different classes.
This means that I need to add extra parameters to the paginat开发者_开发问答ion 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?
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!
精彩评论