Reputation: 265
I'm using Kurourin Pagination package in meteorJS framework and it's not working. It only returns an error in my blaze html file. It also only displays loading in my html file. I'm only new to the package so please understand.
Code is below according to the documentation in the atmosphere
//Error
Error: No such template: defaultBootstrapPaginator
at blaze.js:3212
at Blaze.View.<anonymous> (spacebars.js:68)
at blaze.js:1934
at Function.Template._withTemplateInstanceFunc (blaze.js:3744)
at blaze.js:1932
at Object.Blaze._withCurrentView (blaze.js:2271)
at viewAutorun (blaze.js:1931)
at Tracker.Computation._compute (tracker.js:339)
at new Tracker.Computation (tracker.js:229)
at Object.Tracker.autorun (tracker.js:613)
//blaze html file
<div class="row">
{{#if isReady}}
<ul class="list-group">
{{#each platforms}}
<li class="list-group-item">{{platform}}</li>
{{/each}}
</ul>
{{> defaultBootstrapPaginator pagination=templatePagination limit=10 containerClass="text-center" onClick=clickEvent}}
{{/if}}
</div>
//create_hardwarepl.js file
Template.create_hardwarepl.onCreated(function () {
this.pagination = new Meteor.Pagination(Platforms, {
sort: {
_id: -1
}
});
});
Template.create_hardwarepl.helpers({
platforms: function()
{
return Platforms.find({},{sort: {createdAt: -1}});
},
isReady: function ()
{
return Template.instance().pagination.ready();
},
templatePagination: function ()
{
return Template.instance().pagination;
},
documents: function ()
{
return Template.instance().pagination.getPage();
},
// optional helper used to return a callback that should be executed before
changing the page
clickEvent: function()
{
return function(e, templateInstance, clickedPage)
{
e.preventDefault();
console.log('Changing page from ',
templateInstance.data.pagination.currentPage(), ' to ', clickedPage);
};
}
});
//server/publications.js file
import { publishPagination } from 'meteor/kurounin:pagination';
publishPagination(Platforms);
Upvotes: 1
Views: 296
Reputation: 1
Add the meteor package kurounin:pagination-blaze: meteor add kurounin:pagination-blaze
See https://atmospherejs.com/i/installing
Upvotes: -1
Reputation: 293
I got the same issue that you faced and then I have checked the kurourin GitHub repositories and there is another subscribes based pagination.click this link
Above link will help you
Upvotes: 3