Grails: Change number of records displayed with Remote-Pagination
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 :
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
WHERE TO ADD these?? i am confused .. grails.views.javascript.library = “jquery” .. THANK YOU
where to add this?i am confused..THANK YOU
Thankѕ very interesting blog!
Hi,
can you please send me the source code of this example, my email is :
majidnakit@yahoo.com
Thanks lot.
Hi, Thanks for the plugin. Is it possible to use the same with jquery?
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”
Nice plugin, very useful. Do you have plans for an “all” setting in the page size?
@ 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.