I've a pop-up to display the user list which would display 10 results per page, which is working fine.
I'm getting the page nos. from the java servlet in the JSON.
How do I disable the previous button, when it is the first page?
Likewise, how do I disable the last button, when it is the last page?
Here's my code.
- function UserList(pageNo) {
- var resType="userList";
- getResults(resType,pageNo);
- $(document).on('click', '.next-btn', function(){
- var next = 10+pageNo;
- UserList(next);
- });
- $(document).on('click', '.prev-btn', function(){
- var previ = pageNo - 10;
- UserList(previ);
- });
- }