Comments (1)
That method is not supposed to return the documents, only set the page and return the newly set page number.
If you want to set the page from url, you should set it when initializing, In your template javascript file (e.g. client/scripts/mylist.js):
Template.myList.onCreated(function () {
this.pagination = new Meteor.Pagination(MyCollection, {
page: Number(FlowRouter.getQueryParam('page')),
sort: {
_id: -1
}
});
});
and use the getPage()
method to return the documents in a helper:
Template.myList.helpers({
documents: function () {
return Template.instance().pagination.getPage();
}
});
If for some reason (the page is not available when instantiating) you want to set the page after initializing the pagination component you can use:
templateInstance.pagination.currentPage(pageNumb);
but you still need to get the documents in a helper, using the Template.instance().pagination.getPage()
method.
from pagination.
Related Issues (20)
- Question: can these subscriptions be "unblocked"? HOT 5
- Question: what is the best way to pass a "limit" parameter from the client to the server? HOT 3
- Could the package be modified to use "aggregate" and not "find"? HOT 2
- Is there a recommended way to "close" a pagination? HOT 2
- Meteor v3 upgrade? HOT 1
- How does one set a limit on the total maximum number of documents to retrieve? HOT 2
- I want to concatenate/transform the doc before publishing HOT 5
- 'Pagination undefined reactive subscribe' error HOT 2
- QUESTION: Does this package support infinite scrolling? HOT 4
- Can't get method totalItems() to work HOT 2
- Publication is never ready inside constructor HOT 11
- Custom sort on pagination HOT 3
- Search in all Pages from Pagination HOT 5
- Reactivity does not work. When adding a new record, the list of documents does not get updated. HOT 3
- How to programmatically got to the next page? HOT 1
- Can the pagination be initialized to display the last page? HOT 2
- Multiple pagination load order HOT 1
- Question: are aggregate queries supported? HOT 2
- How to catch the event when pagination is ready, AND the corresponding DOM elements finished rendering? HOT 2
- Pagination does not work with pub-sub-lite package.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagination.