Note you’ll need a data source for this whole process to work. here mine ;
var allUsers = Meteor.users.find().fetch();
function toSingleUser(allUsers) {
$.each(data, function (index, item) {
html += Blaze.toHTMLWithData(Template.userBox, item) //
});
return html
}
$('#whereyouwanto').pagination({
dataSource: Meteor.myusers.find().fetch() ;// or allUserx
, callback: function (data, pagination) {
var html = toSingleUser(data)
$('#anything').html(html);
}
})
and then suggest paginationjs, which is clearly a package, and even depends on jQuery
You should take a look at some of the patterns for pagination that relies on Meteor’s subscriptions and publications, which’ll not only help you paginate/infinite scroll, but also reduce the amount of data loaded into minimongo on the client. here’s an example
Yeah I’m pretty sure the whole point of pagination is to avoid sending too much data to the client. If you have 100,000 records on the server and want to load/display just 10 at a time, a jquery plugin can’t help you there.
i need just a client pagination for UI… found https://github.com/Navybits/meteor-pagination works great with Blaze and Meteor. only a small issue, if i search something not from the first page, it stays in current page and the result is on page 1. all others are great!
BTW, the link of paginationjs is now https://pagination.js.org/