+ Start a Discussion

pagination on single page

Hi All,

I want to display mutiple records on page using pagination.

i want create a next button and on clicking of this button the want display next set of records along with the current records.

Is there any way that I can append the newly fetched records with previous records?

Ajaykumar SadanandeAjaykumar Sadanande
Fetch all the records once and you can play with a bit of javascript logic. 
Gonzalo AbrunaGonzalo Abruna

you may find querylocator useful for that: https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_querymore_querylocator.htm

If querylocator is not enough for your needs, you might want to use OFFSET param in a SOQL statement: http://www.salesforce.com/us/developer/docs/soql_sosl/Content/sforce_api_calls_soql_select_offset.htm

Both ways are good to implement pagination.

Following is the sample pagination code. Please have a look.

This work as normal pagination. when i click next the records have to be displayed with past records 

i.e current page has 5 records when i click next in the same page it has to load new 5 records and previous  5 records total of 10 records 
can i have sample implementation using javascript