Kurounin / Pagination

This package allows you to paginate the subscriptions over meteor's collections. It can be used in a Blaze template or in ReactJS.
MIT License
56 stars 22 forks source link

Can't get method totalItems() to work #88

Closed carlosalvidrez closed 6 years ago

carlosalvidrez commented 6 years ago

Hi there... quick question... trying a brand new basic template... not getting the totalItems() method to work... it is returning undefined. Wondering if I missed anything in the setup.

HELPER: , "totalItems": function () { return Template.instance().pagination.totalItems(); }

CREATED template event snippet: // Pagination this.pagination = new Meteor.Pagination( asdf , { name: "asdf2" , sort: { vk:1 } , fields: {} , perPage: 12 , page: 1 , filters: {a:2, b:1} , reactive: true , debug: true } );

Kurounin commented 6 years ago

Hi,

totalItems() will return the number of documents only after the subscription isReady() and the getPage() was called to display the documents in the template.

carlosalvidrez commented 6 years ago

My mistake! Thanks... I was not using getPage on the "documents" helper. Sorry