Closed mylastore closed 6 years ago
Now i formatted this way res.render('account/order-history', {orders: orders, pagination: { page: currentPage, limit: limit, totalRows: rows }});
and is not working either currently have the limit to 5 but does not seem to take effect
Is this suppose to be a completely separe view just for the pagination or it could be a combination for example on my orders saved and pagination all in one view and controller?
@mylastore I think there is something wrong your code that renders overview orders. This module only is related to give pagination elements and does not relate to overview part. I see the pagination is coming so the module is working fine but there may be something wrong with your code.
@babiz ah ok that's what I wanted to know, so I have to handle the rendering of the individual chunks of data of each age?
Basically, this is how I integrate this in the controllers.
res.render('contacts/index', {
contacts: contacts.rows,
pagination: {
page: req.query.page,
limit:req.query.limit,
totalRows: contacts.count
}
});
Then iterate the contacts object in the view using loop command to show the view. SOmething like this
{{#each contacts as |contact|}}
<tr>
<td>{{contact.name}}</td>
<td>{{contact.organization}}</td>
<td>{{contact.email}}</td>
..............
......
@babiz I try the page: req.query.page did not work for me but go it to work this way. Hope it helps someone else.
I could see the pagination element but does not render the rest of the view.