1

I want to dynamically load data while Scrolling a GSP Page Down like facebook does.

Is that possible ?

I am using grails 1.3.7 thanks.

Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
mehdouch
  • 423
  • 1
  • 8
  • 20

2 Answers2

6

You can detect whether scroller has reached the end of page. If so, just load new piece of information. Something like

$(window).scroll(function(){
    if  ($(window).scrollTop() == $(document).height() - $(window).height()){
       loadNewData();
    }
});

function loadNewData(){
    /* add code to fetch new content and add it to the DOM */
}

Here is an example on jsFiddle

http://jsfiddle.net/QsNCy/

Marian Bazalik
  • 1,351
  • 1
  • 13
  • 30
2

You can also refer tag remotePageScroll of remote-pagination plugin version 0.3, to load and append more records to the existing list on a click of a button, just like what linkedin does. Cheers!

Amit Jain
  • 1,372
  • 8
  • 16