meteor-pages
meteor-pages copied to clipboard
More than 2 Paginated pages/collections infinite loading
I started my project with a single Pagination object. It was for a Product Collection, worked fine.
Needed a 2nd page/template/collection with Pagination. Used the same process the 2nd time, works perfectly.
Did the same thing again for a 3rd page/template/collection. As soon as a 3rd pagination object is created, 1 of the 3 will then have an infinite loading.
I tested multiple times to made sure I made no mistakes, and used the same exact process for setting it up. It seems that 3 Pagination objects causes infinite loading?
@SpyridonZ any luck? Are you sure that reason is in paginated collections count? I faced the same problem after updating my application from meteor 1.2 to 1.3.
@radik None yet. But I did receive a post from someone suggesting a fix. I have not tried it yet. Here is what he suggested:
"Same thing happens to me for more than 2 pagination objects until i call paginatedCollection.set() (for filtering). So for the meantime i just placed a paginatedCollection.set() on Template.templatename.rendered to get it to work."
If you try that and it works, please post here that it worked!
@SpyridonZ that was me, i forgot why i deleted the comment, but to be exact it's paginatedCollection.set(function(){return 1});. I get a message saying "changing deprecated not allowed" but i just ignore it.
@SpyridonZ Following helped for me
// inside Template.projects_list.onRendered
ProjectsPage.requestPage(1);
Seems like something happened with initial page loading. I tried ProjectsPage.set for filter, but it didn't work when filter is empty.
Thanks @radik 👍
Worked for me as well, thanks for sharing!
Thank you, @radik!!! This saved me.
Same problem here. Didn't do thorough testing to be sure of the problem but I had 3 x pagination collections and the same issue with the infinite spinner on one of them.
Tried both the .requestPage(1) and the .set(function(){return 1}) fixes from within onRendered (and indeed an onClick event but with no joy.
the fix for me was to give a different name to each declaration. I was using "Pages" for all three collection.
ie: this.Pages = new Meteor.Pagination(Collection, { route: ... router:... etc... });
Worked fine for 2 collections but not when the third came along....
Thanks a million, requestPage(1); saved me another day of frustration. I also ran into this issue when using more than two pagination objects.
This used to workbefore alethes-pages updated to Meteor 1.3. Before that, you could have any number of pagination objects. Now if there are more than 2 from the same collection, the later ones don't provide any results.
Many thanks to @radik for the suggestion to use requestPage when the template is rendered:
// inside Template.projects_list.onRendered
ProjectsPage.requestPage(1);
where ProjectsPage is the name of your pagination object
This fixed it for me.