meteor-pages icon indicating copy to clipboard operation
meteor-pages copied to clipboard

example with flow router

Open Alino opened this issue 9 years ago • 22 comments

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 avatar Sep 01 '15 11:09 Alino

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.

Alino avatar Sep 01 '15 11:09 Alino

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

sungwoncho avatar Sep 08 '15 23:09 sungwoncho

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.

benwalks avatar Sep 08 '15 23:09 benwalks

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

nicholasalanbrown avatar Sep 16 '15 02:09 nicholasalanbrown

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

Alino avatar Sep 16 '15 12:09 Alino

@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.

sungwoncho avatar Sep 16 '15 12:09 sungwoncho

+1

craigbennett1981 avatar Oct 01 '15 07:10 craigbennett1981

+1

rootedsoftware avatar Nov 17 '15 20:11 rootedsoftware

+1

nitya avatar Dec 02 '15 05:12 nitya

+1

veyronfei avatar Dec 10 '15 06:12 veyronfei

Any work around? Please share.

macroramesh6 avatar Dec 25 '15 09:12 macroramesh6

Any news?

rdewolff avatar Dec 31 '15 11:12 rdewolff

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

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

tim-phillips avatar Feb 09 '16 19:02 tim-phillips

+1

jlourenco avatar Mar 04 '16 15:03 jlourenco

+100

sibinx7 avatar Mar 09 '16 05:03 sibinx7

+1

wemyss avatar Mar 27 '16 23:03 wemyss

+1

ghost avatar Mar 28 '16 06:03 ghost

+1

tomyo avatar Apr 18 '16 22:04 tomyo

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).

tomyo avatar Apr 27 '16 21:04 tomyo

++1

krem06 avatar Jul 04 '16 09:07 krem06

+1

vedovato avatar Jul 04 '16 14:07 vedovato

+1

wangdengbin avatar Dec 26 '16 02:12 wangdengbin