How to Refresh Pagination Links via AJAX in Liftweb using Scala

Table of contents
Reading Time: < 1 minute

In our previous blog , we explained about using Pagination in Lift using Scala . But If you render a page via AJAX , pagination link would not be refreshed until we reload the page .
In this blog , we will have a basic idea that how to refresh pagination via AJAX .
Suppose you are displaying an item list on web and you want to paginate that list then you have to implement PaginatorSnippet in your snippet class file .

Override count , itemPerPage and page properties .

count – number of all items you have (here all Measurements)
page – represents current slice
itemPerPage – Number of Items per page

Now define RequestVar holders for Pagination

Now define render method .

Finally add below markup in your HTML file .

Source Code : You can found source code on the Knoldus GitHub account here : Login Template using Liftweb and Scala .

Written by 

Ayush is the Sr. Lead Consultant @ Knoldus Software LLP. In his 10 years of experience he has become a developer with proven experience in architecting and developing web applications. Ayush has a Masters in Computer Application from U.P. Technical University, Ayush is a strong-willed and self-motivated professional who takes deep care in adhering to quality norms within projects. He is capable of managing challenging projects with remarkable deadline sensitivity without compromising code quality.

1 thought on “How to Refresh Pagination Links via AJAX in Liftweb using Scala1 min read

Comments are closed.

Discover more from Knoldus Blogs

Subscribe now to keep reading and get access to the full archive.

Continue reading