{"id":1135,"date":"2010-06-29T15:40:21","date_gmt":"2010-06-29T10:10:21","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=1135"},"modified":"2016-12-19T15:19:22","modified_gmt":"2016-12-19T09:49:22","slug":"grails-change-number-of-records-displayed-with-remote-pagination","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/grails-change-number-of-records-displayed-with-remote-pagination\/","title":{"rendered":"Grails: Change number of records displayed with Remote-Pagination"},"content":{"rendered":"<p>Hi Friends,<\/p>\n<p>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 <a href=\"http:\/\/www.grails.org\/plugin\/remote-pagination\">documentation<\/a>, lets have a look at the example below :<\/p>\n<blockquote>\n<pre lang=\"groovy\">\/\/Example Domain:\r\nclass Book {\r\nString title\r\nString author\r\n}\r\n\r\n\/\/Example controller:\r\nclass BookController {\r\ndef list = {\r\n[books: Book.list(params)]\r\n}\r\n\r\ndef updateList ={\r\nrender(template:\"listTemplate\" ,model:[ bookInstanceList: Book.list(params )]) }\r\n}\r\n\r\n\/\/GSP Code :<\/pre>\n<\/blockquote>\n<p>Demo Image :<\/p>\n<p style=\"text-align: center;\">\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2010\/06\/pagination.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-1137 \" title=\"pagination\" src=\"\/blog\/wp-ttn-blog\/uploads\/2010\/06\/pagination.png\" alt=\"Demo image\" width=\"450\" height=\"400\" \/><\/a><\/p>\n<p style=\"text-align: left;\">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.<\/p>\n<p>Hope this helped!<\/p>\n<p>~~Amit Jain~~<br \/>\namit@intelligrape.com<br \/>\nhttp:\/\/www.tothenew.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 { [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":11},"categories":[7],"tags":[4840,296,295],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/1135"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=1135"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/1135\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=1135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=1135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=1135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}