alethes / meteor-pages

Meteor pagination
MIT License
403 stars 84 forks source link

Total number of items #216

Closed boboci9 closed 8 years ago

boboci9 commented 8 years ago

Hi, Could you tell me how can I get the total number of items for a pagination? This is what I tried:

Template.search.created = function(){
    this.orderPagination = new Meteor.Pagination(Orders, {
        filters:{ $and:[
            Filters.General.notDeleted
        ]},
        perPage:5
    });
}
Template.search.helpers({
orderResult: function(){
    return Template.instance().orderPagination.getPage();
},
orderResultCount: function(){
    return Template.instance().orderPagination.settings.keys.totalItems; //this is undefined
}
})

Thanks.