Grails: Change number of records displayed with Remote-Pagination

29 / Jun / 2010 by Amit Jain 8 comments

Hi Friends,

I have released version 0.2.3 of remote-pagination plugin, which includes an option to enable user to change page sizes out of the given options. As given in the documentation, lets have a look at the example below :

//Example Domain:
class Book {
String title
String author
}

//Example controller:
class BookController {
def list = {
[books: Book.list(params)]
}

def updateList ={
render(template:"listTemplate" ,model:[ bookInstanceList: Book.list(params )]) }
}

//GSP Code :

Demo Image :

Demo image

Now when the user changes the page size, it updates the number of records in a table asynchronously. We can also pass additional parameters if needed, using the params attribute.

Hope this helped!

~~Amit Jain~~
amit@intelligrape.com
http://www.tothenew.com

FOUND THIS USEFUL? SHARE IT

comments (8)

    1. Amit Jain

      Yes it is. This plugin uses grails tags behind the scenes. So if you use jQuery for grails tags, it would automatically be using the same.
      To enable jQuery for grails tags we just need to add the following line :
      grails.views.javascript.library = “jquery”

      Reply
    1. Amit Jain

      @ Ingo, I believe ‘all’ option may not be appropriate where we use pagination. So I have no plans for the same in the near future.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *