alethes / meteor-pages

Meteor pagination
MIT License
403 stars 84 forks source link

example with flow router #174

Open Alino opened 9 years ago

Alino commented 9 years ago

Please, could someone provide an example how to use basic pagination with flow router? Or any other router than iron-router? From the README I cannot understand how to configure it manually by myself when I set options for pages to router: true on client side.

Alino commented 9 years ago

first bulletpoint in this part of the README is the thing I struggle with here:

router (String, default = undefined) - Three options:

  • true - a router is used but the routes are configured separately by the user
  • false - no router used
  • "iron-router" - iron-router is used and the routes are automatically set up by Pages

So I got on my client code

Template.myItemTemplate.onCreated(function() {
  return Pages.set({
    router: true
  });
});

but chrome console gives me then this error:

Exception from Tracker recompute function: Error: Match error: Failed Match.OneOf or Match.Optional validation

What else should I do? Something with flow router I guess but what :D My goal is to have routing for pages like .../page/1 .../page/2 and so on.

sungwoncho commented 9 years ago

I'm in the similar situation. Are you using this package successfully with Flow Router?

benwalks commented 9 years ago

You can not add the router option and standard pagination should be OK. I had a hard time getting it to work with infinite scroll though.

nicholasalanbrown commented 9 years ago

+1 for a Flow Router (ideally + React.js) example...

Alino commented 9 years ago

@sungwoncho unfortunately I am not successful in using this with flow router yet. Example is needed.

sungwoncho commented 9 years ago

@Alino Yeah an example would be nice. I ended up implementing my own pagination because my case was simple. I only needed 'prev' and 'next' button not the page numbers.

craigbennett1981 commented 9 years ago

+1

rootedsoftware commented 9 years ago

+1

nitya commented 9 years ago

+1

veyronfei commented 8 years ago

+1

macroramesh6 commented 8 years ago

Any work around? Please share.

rdewolff commented 8 years ago

Any news?

tim-phillips commented 8 years ago

+1, flow router is now the official router used in the Meteor guide.

http://guide.meteor.com/routing.html#flow-router

jlourenco commented 8 years ago

+1

sibinx7 commented 8 years ago

+100

wemyss commented 8 years ago

+1

ghost commented 8 years ago

+1

tomyo commented 8 years ago

+1

tomyo commented 8 years ago

In the mean while, this minimal package got me going: https://github.com/miguelalarcos/flow-router-pagination. The key is to use tmeasday:publish-counts package for real time counting the documents (used by the flow-router-pagination package).

krem06 commented 8 years ago

++1

vedovato commented 8 years ago

+1

wangdengbin commented 7 years ago

+1