Your cart
  • IMG
    {{cart_item.name}}
    {{cart_item.variation_attribute_name}}: {{cart_item.variation_attribute_label}}
    {{cart_item.item_unit}}: {{ setCurrency(cart_item.price)}}
    {{ setCurrency(cart_item.price*cart_item.quantity)}}
    Invalid quantity more than stock
Total :
{{setCurrency(cart.sub_total)}}

There is no item in the cart. If you want to buy, Please click here.

Step 8: Grails pagination

Complete Application using Grails 3

Created by :
Grails
tutorial
Programming, Software and application
1090
2020-10-14 16:12:27

Grails's paginator is integrated with the query builder and Eloquent ORM and provides convenient, easy-to-use pagination of database results out of the box. The HTML generated by the paginator is compatible with the Bootstrap CSS framework.

In this example, for pagination, we need to set limit in the controller.  we will paginate the Contact model with 5 items per page. So we can set this as like

$contacts = Contact::paginate(5);

For Displaying Pagination Results in the view, just write {{ $users->links() }} which will render using blade and the HTML generated by the links method is compatible with the Bootstrap CSS framework.

There are several ways to paginate items. For more - https://grails.com/docs/5.4/pagination