Remote-Pagination « Intelligrape Groovy & Grails Blogs

Posts Tagged ‘ Remote-Pagination ’

Remote-pagination : support for javascript events added

Posted by Amit Jain on March 14th, 2011

Hi Friends,

I have released the version 0.2.5 of Remote-Pagination, which now provides the support for all the events as supported by grails tags like remote-link.  Events supported are listed below :

  1. onSuccess  – The javascript function to call if successful
  2. onFailure  – The javascript function to call if the call failed
  3. on_ERROR_CODE – The javascript function to call to handle specified error codes (eg on404=”alert(‘not found!’)”). With Prototype, this prevents execution of onSuccess and onFailure.
  4. onUninitialized  – The javascript function to call the a ajax engine failed to initialise
  5. onLoading  – The javascript function to call when the remote function is loading the response
  6. onLoaded  – The javascript function to call when the remote function is completed loading the response
  7. onComplete  – The javascript function to call when the remote function is complete, including any updates.

Version 0.2.5  fixes the jira issue GRAILSPLUGINS-2804.

For any new feature request or a bug please raise a jira here.

Thanks for all your support!

~~Amit Jain~~

amit@intelligrape.com

http://www.IntelliGrape.com

  • Share/Bookmark
Posted in Grails

Grails: Change number of records displayed with Remote-Pagination

Posted by Amit Jain on June 29th, 2010

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.IntelliGrape.com

  • Share/Bookmark
Posted in Grails