I am doing pagination in my web app so how to do this ?
what i want is : i wan to show all the users to admin!
i went through this play framework computer app computer-database but i don't want this type of pagination
computer -database app pagination is :

but i want like google :

my query same like computer-database app:
model part of user
public static Page<User> page(int page, int pageSize, String sortBy, String order, String filter) {
return
find.where()
.ilike("name", "%" + filter + "%")
.orderBy(sortBy + " " + order)
.findPagingList(pageSize)
.getPage(page);
}
view is:
adm.scala.html
and contoller is :
public static Result enter() {
Form<Login> loginForm = Form.form(Login.class).bindFromRequest();
if (loginForm.hasErrors()) {
return badRequest(logi.render(loginForm));// errorsAsJson());
}
if(loginForm.get().email.equals("[email protected]") ) {
return redirect(routes.paging.pag(0, "name", "asc", ""));
}
and paging.java
public class paging extends Controller {
public static Result pag(int page, String sortBy, String order, String filter) throws ClassNotFoundException, SQLException {
return ok(adm.render(User.page(page, 2, sortBy, order, filter),
sortBy, order, filter));
}
Give me some idea for that pagination.
You can use paginate module on play, try this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With