customRenderPagination parameter Question
See original GitHub issueI’m trying to utilize the customRenderPagination parameter for the Pagination component, but am unable to get the custom template rendered as expected. Is my usage of the component incorrect, or is there something else going on? I did not see the parameter used in the leaderboard example to compare against.
The code below shows a basic program attempting to utilize the parameter. Thanks for this awesome package.
JS
People = new Mongo.Collection('people');
Factory.define('person', People, Fake.user({ fields: [ 'name', 'email',
'surname']}));
PeopleIndex = new EasySearch.Index({
collection: People,
fields: ['name', 'email'],
engine: new EasySearch.Minimongo()
});
if (Meteor.isClient) {
Template.main.helpers({
'peopleIndex': function() {
return PeopleIndex;
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
var numPeople = People.find().fetch().length
if(numPeople < 100) {
for(numPeople; numPeople < 100; numPeople++) {
Factory.create('person', Fake.user({ fields: [ 'name', 'email',
'surname']}));
}
}
});
}
HTML
<head>
<title>learn_easy_search</title>
</head>
<body>
<h1>Welcome to Meteor!</h1>
{{> main}}
</body>
<template name="main">
Search: {{> EasySearch.Input index=peopleIndex}}
<h2>People</h2>
<ul>
{{#EasySearch.Each index=peopleIndex}}
<li>{{name}}</li>
{{/EasySearch.Each}}
</ul>
{{> EasySearch.Pagination index=peopleIndex maxPages=10
customRenderPagination=test}}
</template>
<template name="test">
<h3>Testing Custom Pagination Template</h3>
</template>
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to Build a Custom Pagination Component in React
We render the Pagination component as a list with left and right arrows which handle the previous and next actions the user makes....
Read more >How To Build Custom Pagination with React | DigitalOcean
In this tutorial, you will learn how to build a custom pagination component with React for paginating large datasets.
Read more >Custom pagination in datatables using count as parameter
I am using datatable(datatables.net) to display rows of data. For performance issues...instead of loading hundreds of rows , based upon the ...
Read more >React pagination from scratch using Hooks - LogRocket Blog
It takes a single argument, which is the initial state. In the example above, the currentPage variable is set to 1 by default....
Read more >Simple Frontend Pagination | React - YouTube
In this video we will implement some custom pagination in React to get a certain number of fetched posts per page. We will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No there’s not right now, I’ll create an issue to add an example to the docs.
I there an example of how customRenderPagination works? It’s displaying the template but I’m not sure how to get the template to work.