From the question you have posed, and the information you have provided, there is not a simple ‘do this’ answer. You need to get a bit further down the path of what you want to achieve. (unless someone knows some magic foo that I am unaware of).
Looking at what you have so far, it would seem that you have the basic functionality of the page, and you have an idea of what you want to achieve, but you do not yet appear to have a strategy or plan for how you are going to achieve it. I have never implemented continuous scroll, but giving it some cursory thought, I would begin by asking myself some questions.
- How is the page update going to take place when I extend the contents.
eg. - replace the whole page each time the list updates
or - replace the list section
or - add additional items at the end
Do I let the page size continue to grow indefinitely or do I remove some items from the other end.
If I am going to manage addition/deletion of items. The items will probably be best structured in an an html list or table, and each may need a unique id, or can I just append/prepend to the list of items.
What mechanism will I use to identify the next ‘page’ of items I want to add to the list.
How is my controller going to get the correct list of items to add? ie what paging mechanism am I using.
How am I going to handle the ajax response that contains the items. I am going to need some js code to append/prepend or insert the items into the list.
Finally having thought about all this, I would do some googling to see if someone has already implemented such a thing in a form I could learn from, or is there maybe a js library that might already provide most of the functionality I require.
I am sorry this is not a direct answer, but hopefully it may help to clarify what you are trying to achieve and how you are going to go about it.