Hi All
Grails provides us many plugins to tackle problems in development. Today I'm going to tell one of its plugins called grailsPaginationTag. This plugin is used to handle pagination for list that you render on the web page.
For this plugins Just add one line in the config.groovy file .
compile ":remote-pagination:0.4.8"
Remote pagination plugins provides us tage for pagination using ajax without page loading. It provides us many tag for pagination for list of object you needed.
For Example:
public class Person{
String name
long id
}
On controller
public class PersonController{
def list{
[list:Person.list()]
}
def filterPersonList{
render('listTemplate',model:[count:Person.list().size(),list:Person.list()])
}
}
Now on your _listTemplate gsp
<util:remotePagination action='filter' controller='person' total='count' update='listTemplateDiv' max='10' params=['id':1] maxsteps='8'>
Action: name of the link to be used in the pagination
Total: size of the list
update : id of the div/span which contain the template
max: fetch max list
params:pass your own params
maxsteps: The number of step displayed for the pagination
Thanks
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Deepak Gupta
Deepak is a bright Groovy and Grails developer