Coder Social home page Coder Social logo

meteor-pages's Introduction

Meteor Pages

Out-of-the-box Meteor pagination

Live demos:

Basic usage - http://pages.meteor.com/

Table (using fast-render) - http://pages-table.meteor.com

Reactive, multiple collections - http://pages-multi.meteor.com/

Infinite scrolling - http://pages3.meteor.com/

Live help

Do you need some assistance with Meteor development? I'm happy to help.

Features

  • Incremental subscriptions. Downloads only what is needed, not the entire collection at once. Suitable for large datasets.
  • Local cache. One page - one request. Saves and reuses data on subsequent visits to the same page.
  • Neighbor prefetching. After loading the current page, it prefetches the neighbors to ensure seamless transitions.
  • Request throttling. Allows you to limit how often the page can be changed.
  • Easy integration. The package works out of the box. Page changes are triggered by a single session variable.
  • Multiple collections per page. Each Pagination instance runs independently. You can even create multiple paginations for one collection on a single page.
  • Bootstrap 2/3-compatible navigation template. The package itself borrows some CSS from Bootstrap 3 to ensure good looks without dependency, but can be re-styled easily.
  • Failure resistance. Accounts for multiple scenarios of failure.
  • Built-in iron-router integration. Binds easily to any other router.
  • Infinite scrolling. Easily controlled and fully leveraging the package's powerful features.
  • Automatic generation of paginated tables.
  • Secure design. Effortlessly control what to publish, when to publish and what view modifications to allow (using the availableSettings feature).
  • Built-in authorization support. Easily restrict data access according to arbitrary sets of rules.
  • Trivial customization on the fly. Items per page, sorting, filters and more adjustable on the fly! Just modify a setting and see the pagination redrawing.
  • Live sort. All changes in the data are immediately reflected. Items move around within and across pages according to arbitrary sorting rules.

Installation

Meteor 0.9+: meteor add alethes:pages

Meteorite: mrt add pages

Basic usage

JavaScript/CoffeeScript (in common code, running on both the server and the client):

this.Pages = new Meteor.Pagination("collection-name");

and HTML:

<body>
    {{> collection-name}}
</body>
<template name="collection-name">
    {{> pages}}
    {{> pagesNav}}  <!--Bottom navigation-->
</template>

Of course, you can use any variable to store the object returned by new Meteor.Pagination(), not necessarily Pages.

As for the customizations, there's a multitude of options. You'll most likely want to define your own template for the paginated items. When you do, you can pass it's name to the Meteor.Pagination constructor:

this.Pages = new Meteor.Pagination("collection-name", {
  itemTemplate: "myItemTemplate"
})

Settings

Settings can be passed as a second argument to Meteor.Pagination(). Many of them can be changed on the client-side, causing an immediate redraw. Unless stated otherwise, user-defined functions are called in the context of the Pagination object.

There are two ways to modify settings:

  1. In common code, during declaration (client and server):
this.Pages = new Meteor.Pagination("collection-name", {
  perPage: 20,
  sort: {
    title: 1
  },
  filters: {
    count: {
      $gt: 10
    }
  },
  availableSettings: {
    perPage: true,
    sort: true
  }
});
  1. Client-side code / common code (client and server), after declaration:
Pages.set({
  perPage: 10,
  sort: {
    title: -1
  }
});

Available to the client anytime:

  • dataMargin (Number, default = 3) - determines how many neighboring pages on each side should be prefetched for seamless transition after loading the current page. Prefetching stops when the subscription limit (imposed by maxSubscriptions) is reached.
  • filters (Object, default = {}) - MongoDB find query object, eg. {name: {$lt: 5}}
  • itemTemplate (String, default = "paginateItemDefault") - name of the template to use for items. The default template simply lists all attributes of an item
  • navShowEdges (Boolean, default = false) - whether to show the links to the edge pages («) in the navigation panel. If true, overrides navShowFirst and navShowLast.
  • navShowFirst (Boolean, default = true) - whether to show the link to the first page («) in the navigation panel. If true, overrides navShowEdges.
  • navShowLast (Boolean, default = true) - whether to show the link to the last page (») in the navigation panel. If true, overrides navShowEdges.
  • onReloadPage1 (Boolean, default = false) - determines whether to navigate to page 1 after reloading caused by a change in settings (eg. new sorting order)
  • paginationMargin (Number, default = 3) - the number of neighboring pages to display on each side of the navigation panel
  • perPage (Number, default = 10) - number of items to display per page or to load per request in case of infinite scrolling (cannot be larger than server-imposed pageSizeLimit)
  • requestTimeout (Number, default = 3) - number of seconds to wait for a response until retrying (usable mainly when there are many collections on the page)
  • route (String, default = "/page/") - route prefix used for subsequent pages (eg. "/page/" gives "/page/1", "/page/2" etc.)
  • 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
  • routerTemplate (String, default = "pages") - a template used by iron-router to generate paging
  • routerLayout (String, default = "layout") - a layout used by iron-router to generate paging
  • sort (Object, default = {}) - MongoDB sort determining object, eg. {name: 1}
  • templateName (String, default = "") - A name of the template to use. Defaults to the collection's name.

Unavailable to the client and not changeable on server either after pagination object is initialized:

  • auth (Function, default = undefined) - authorization function called by the built-in publication method with the following arguments:

    • skip - precalculated number of items to skip based on the number of page being published. Useful when returning a cursor.
    • subscription - the Meteor subscription object (this in Meteor.publish()). In authenticated connections, subscription.userId holds the currently signed-in user's _id. Otherwise, it's null. The authorization function is called in the context of the Pagination object. The page number is not exposed because it shouldn't be necessary and page-dependent authorization rules would render calculation of the total number of pages ineffective. The total page count is needed for displaying navigation controls properly.

    The authorization function should return one of the following:

    • true - grants unrestricted access to the paginated collection
    • a falsy value - denies access to the paginated collection
    • a Number - publishes only pages with page number not greater than the specified number (1-based numbering is used for pages).
    • an Array of the form: [filters, options] - publishes this.Collection.find(*filters*, *option*)
    • a Mongo.Collection.Cursor (or some other cursor with a compatible interface) - publishes the cursor.
    • an Array of Mongo.Collection.Cursor objects (or some others cursor with a compatible interface) - publishes the cursors. When publishing a cursor or an array of cursors, you have to make sure to set realFilters (filters used in publication; sometimes different from filters visible to the client) or nPublishedPages (explicit number of published pages) manually to ensure proper rendering of navigation controls. In most cases, it's recommended to return an array with filters and options (option 4) instead.
  • availableSettings (Object, default = {}) - defines rules for changes in settings initiated by the client. A valid entry references the name of a setting by key and has one of the following as a value:

    • true - allows all changes to the setting (if not otherwise limited by constraints such as pageSizeLimit)
    • a falsy value - explicitly disallows all modifications. Has the same effect as leaving the setting out.
    • a Function - defines a policy controlling changes in the specified setting.
  • divWrapper (String, Boolean, default = "pageCont") - if it's specified and table mode is not enabled, the Pagination page is wrapped in a div with the provided class name

  • fastRender (Boolean, default = false) - determines whether fast-render package should be used to speed up page loading

  • homeRoute (String, default = "/") - if "iron-router" is enabled, the specified route sets currentPage to 1

  • infinite (Boolean, default = false) - infinite scrolling

  • infiniteItemsLimit (Number, default = Infinity) - the maximum number of items to display at once in infinite scrolling mode. If the number (n) is less then Infinity only the last n items are displayed on the page.

  • infiniteRateLimit (Number, default = 1) - determines the minimum interval (in seconds) between subsequent page changes in infinite scrolling mode

  • infiniteTrigger (Number, default = .8) - if infinite scrolling is used, determines how far (for val > 1: in pixels, for 0 > val >= 1: in (1 - percent)) from the bottom of the page should the new data portion be requested

  • initPage (Number, default = 1) - number of the initially displayed page

  • maxSubscriptions (Number, default = 100) - the maximum number of simultaneously active subscriptions per client. Normally, open pages and,if dataMargin is greater than one, their neighbors are cached on the client-side for seamless transitions. To achieve this, multiple subscriptions (each keeping track of a single page) are held open at the same time. This prevents clients from requesting the same page several times as the user navigates back and forth within the paginated set. This lowers the amount of data sent over the wire and decreases server load for mostly static data. However, each addition to, or removal from the set (along with some of the modifications) trigger a cascade of changes in the active subscriptions. In addition, a very high number of simultaneous subscriptions may overload the memory on both the server and the client side. To prevent that, a Pagination instance can keep track of the number of active subscriptions and securely limit them behind the scenes. Each Pagination instance has a separate subscription limit.

  • navTemplate (String, default = "_pagesNav") - name of the template used for displaying the pagination navigation

  • onDeniedSetting (Function, logs "Changing {{setting}} not allowed." to console by default) - called when the setting is unavailable to the client (based on the rules defined in #availableSettings() or lack thereof).

  • pageTemplate (String, default = "_pagesPage") - name of the template used for displaying a page of items

  • pageCountFrequency (Number, default = 10) - determines the number of seconds between the client's subsequent requests for an up-to-date total page count. Shouldn't be less than 1.

  • pageSizeLimit (Number, default = 60) - limits the maximum number of items displayed per page

  • rateLimit (Number, default = 1) - determines the minimum interval (in seconds) between subsequent page changes

  • routeSettings (Function, default = undefined) - an optional function which, when iron-router is enabled, is called (in the context of the Pagination object) from onBeforeAction with the route object (this in onBeforeAction) as an argument. It enables modifying pagination settings (eg. filters) based on the route's parameters (see iron-router example, view 3).

  • table (Object, Boolean, default = false) - generates a table with data from the paginated collection. The following attributes can be provided:

    • fields (Array, required) - an array of fields to be displayed in subsequent columns of the table
    • class (String, default = "") - class name of the table
    • header (Array, default = fields) - an array of labels to be displayed for subsequent columns in the header row of the table. The fields array is used labels if header is not specified.
    • wrapper (String, Boolean, default = false) - a class name of the optional <div> wrapper. The wrapper is not generated if the argument is left out.

Examples

Currently, the following examples are available in the /examples directory:

  • basic - the most straightforward way of using Pages. The default item template simply lists the attributes of each item.

  • changePerPage - basic usage with two buttons enabling immediate changes to the "perPage" setting

  • infinite - infinite scrolling

  • iron-router - a basic example of iron-router integration

  • multi-collection - multiple paginations on a single page

  • table - a data table, constructed automatically based on the list of fields to display

Todos

  • Tests

meteor-pages's People

Contributors

alethes avatar andylash avatar averrips avatar chmac avatar chuangbo avatar czeslaaw avatar dandv avatar drobbins avatar fadomire avatar fletchtj avatar lufengd3 avatar mccormjt avatar rjalili avatar shelkie avatar shkomg avatar timothyarmes avatar vonrussel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-pages's Issues

Spinner spins forever

For me the loading spinner spins forever and beneath it I see the navbar.

I have:

Notices = new Meteor.Collection('notices');

in shared client/server code. And:

NoticesPages = new Meteor.Pagination(Notices, {
    perPage: 10,
    routerTemplate: 'notices',
    templateName: 'notices',
    itemTemplate: 'noticesRow',
    pageTemplate: 'noticesPage',
    router: 'iron-router',
    route: '/notices/page/'   
});

on the client side.

Inside a template called "notices" I have:

        <div class="span10 offset1">
            <table id="notices" class="table table-condensed table-striped table-hover table-bordered">
                <tbody>
                    {{> pages pagesData }}
                </tbody>
            </table>
            <div class="text-center">
                {{> pagesNav pagesData}}
            </div>
        </div>

Additional to the actual problem a couple of things are not clear to me:

  1. In the README the collection parameter to the Meteor.Pagination constructor is shown as "collection-name" implying that it should be in quotes. Is this the case?
  2. The README shows {{> pages pagesData}}. The pagesData part is new in 1.0.x, no? And it's not clear what it means.

I'd be happy to help finesse the documentation if you could provide some insights here.

adjust the publication / subscription name through settings

Hi,
I just tried your plugin for my blog extension. But unfortunately it's not possible having multiple collection pages on one page/route, because the publication name is always the same. Would be nice if through settings the publication name could get edited. I have on the sidebar latest/mostviewed pages of the same collection but currently this is not supported.
Cheers

Is there any way to remove old items?

I'm running into performance issues on mobile, is there any way to start removing items from the top when you're fetching new results? For example add one page and take another away?

What is the licence for this package?

Could you please clarify the licence this package is released under? Because if it's not clarified by you, I really can't use this package without asking for your permission first.

Paging buttons [first and last]

First, thanks for the awesome package!. I might have missed this from the docs, is there a way to go directly to the first page and last page as part of the pagination buttons or is that something we should integrate as package users and handle in our template events ?

pages with tables.

Are you able to pass individual attributes into a table? For example, instead of passing {{{pages}}} , how would I pass individual attributes?

...

  • {{ name}}
  • {{ url}}
  • ...

    Infinite scrolling upwards instead of downwards

    This package looks great, however I need to be able to infinite scroll upwards (instead of downwards) to get older content, similar to HipChat's interface. It doesn't look like this package supports this (unless I'm missing something?) but would be a great feature to add.

    m in checkInitPage is not defined

    If I am on a page of the items (e.g. myhomepage.com/items/2) and click refresh, I got ReferenceError: m is not defined error.

    checkInitPage: ->
        @init = false
        if location.pathname.match new RegExp("#{@route}([0-9]+)")
          p = parseInt m[1]
        else
          p = 1
        @sess "oldPage", p
        @sess "currentPage", p
    

    Problem when used with tables

    Creating an 'tr' item template to render a pageable table as suggested in a previous issue suffers from the problem that the items get rendered within the .pagination-items div that comes from templates.jade. This really throws the table out of whack!

    I couldn't see any documented way to override this particular template so I had to modify the original. A way to customize this would be great.

    <table>
        <thead>
            ...
        </thead>
        <tbody>
            <div style="position:relative;" class="pagination-items">                
                <tr>...</tr>
                <tr>...</tr>
            </div>
        </tbody>
    </table>
    

    Iron-Router support

    Hi, first of all thanks for the module, it's really easy to use even if there are some little things hard to get at first !

    I am trying to implement it in a project, I have a little web interface allowing me to manage 4 collections (it's almost like a CMDB, manage ips / domains for a bunch of clients and data-centers).

    I did all the apps before starting to work on the pagination and when I implement it nothing is working anymore.

    I successfully narrowed it done to Iron-Router, all my pages are obviously written in a layout and rendered through the {{yield}} tag. As soon as yield is somewhere in my page, meteor-pages start to loop on the "collection" rl1 line, if I print some lines I can see that after the first reload, the collection.find().count() is always returning 0.

    I thought this could have been a subscription problem, so I put a waitOn with the good subscription in my router but nothing changed. Maybe there is a specific way to call the paginated subscription ?

    Thanks a lot in advance

    Filters: regex - my results table would be dynamic base on a search field

    First of all, i like meteor pages very much!
    The only thing i don't get is to use a regex filter.
    I like to be able to search the collection case insensitve and/or part of the name.

    filters: { location: 'Amsterdam' } // this is working
    filters: { location: {regex: /amsterdam/i }} // is not working

    Can you please point me to the correct direction?

    Kind regards,

    Lars

    Pages won't re-render when Pages.set({filter: ...}) called on the client-side

    This is probably me being dumb, but the documentation isn't clear to me.

    I have a tiny meteor-pages app not too dissimilar to the 'table' example.

    https://github.com/pedantic-git/luckyvoice-parser/blob/master/songlist-viewer/songlist-viewer.js

    It has a search box, and typing into the search box calls Pages.set({filters: {artist: search}}).

    On the JS console if I type Pages.filters I can see the filter has been changed, but I can't work out how to get the table to redraw.

    Similarly if I just call the Pages.set() in the console or directly in the if (Meteor.isClient) block, the table doesn't redraw (so it's not a scoping thing).

    Is changing the filters not really available to the client-side? Should I be doing this with a method?

    Serverside Publication restriction pre-check?

    My use case is simple: The collection will be restricted to a specific subset of users. Before the Pagination collection publishes data, I need to run some {arbitrary logic} on the server to ensure they have access to the data.

    Is there anything currently in this module that will allow me to do this?

    Table Time Format

    What if I wanted to display a table that has time? Currently if I include the createdAt property it shows: Fri Oct 10 2014 17:24:31 GMT+0800 (PHT)

    Not loading any documents from collection

    I am having difficulties implementing the pagination on my meteor app and I would like you to help me solving this problem.

    So my meteor app has the following directory structure:

    • server folder:
      ---server.js
    • client folder:
      ---client.js
      ---client.html
    • common.js

    In common.js:

    PassatemposBD = new Meteor.Collection("passatempos");
    Pages = new Meteor.Pagination("PassatemposBD") 
    

    Then, in server.js I fill this collection with documents which I fetch from the web (takes around 30 seconds to fill). Then I publish it:

    Meteor.publish('passatempos', function() {
        return PassatemposBD.find({});
    });
    

    Then in client.js:

    Meteor.subscribe('passatempos');
    

    In client.html

    <body>
    <div> Passatempos:</div>
        {{> PassatemposBD}}
    </body>
    <template name="PassatemposBD">
        {{> pages}}
        {{> pagesNav}}  <!--Bottom navigation-->
    </template>
    

    When I run the app, it displays for a brief time (1 second or less) the rotating spin, then simply doesn't show nothing, neither the navigation below. In the browser console there is no error, neither there are errors in the server side.

    Can you explain me what am I doing wrong?

    Thanks

    Infinite scroll position

    Hey,
    When infinite scroll is triggered you lose your current position in the list, as your view remains at the bottom and the items you were looking at are moved up in the list and you have to scroll up and find your last viewed item. It should be that your position remains and the list gets expanded down and you continue scrolling down to view newly loaded items. I used basic example with infinite enabled.

    GroundDB integration

    Hey,

    Excellent package, thank you! I was trying to integrate it with GroundDB for offline use together with appcache package with no luck. When i try to pass a grounded meteor collection and open up the app offline i see that Pages.Collection._collection._docs._map is populated by grounddb, but Pages.PaginatedCollection._collection._docs._map is empty. I am not used to coffeescript and not sure whats going on exactly but it looks that when offline pages stops on reload method. Perhaps there could be some kind of fallback if app is offline and grounddb is present to use the locally stored documents?

    infinite scrolling within a specific div?

    I have a requirement to create infinite scrolling, paginated content within a scrolling div (the body does not scroll, but a smaller box inside the body does).

    It seems like by default this package listens to the body scroll state to determine when it's time to load more content to the client.

    Can this be modified to listen to a different div? Perhaps it would be a good to add another configuration setting to allow this to be specified?

    Thanks!

    How to sort at 'infinite'

    Hi, I want to made a new 'sort' at infinite mode, but after 'PatientPage.set', the sort not change, it also is the old sort. How to made a new sort at 'infinite' mode? Thanks.

    Is this package still being maintained?

    Just trying to make a choice among the many pagination packages. This one seems powerful but no development appears to have happened after the initial burst of work in November 2013.

    paginated items not reactive

    hi there,

    I have a list of items to be paginated. I use the package as directed and it works well, dividing my list into different pages.

    However, when I update one of the list item's properties, I see the item in the page is not being updated in real time. A refresh is required to see the change.

    On the server side, I'm getting these errors on my server console when the update happens:

    I20131231-01:51:08.931(8)? Exception in queued task: Error: Could not find element with id dsG5XJQcYE2opE8KT to change
    I20131231-01:51:09.001(8)?     at _.extend.changed (packages/livedata/livedata_server.js:176)
    I20131231-01:51:09.001(8)?     at _.extend.changed (packages/livedata/livedata_server.js:364)
    I20131231-01:51:09.001(8)?     at _.extend.changed (packages/livedata/livedata_server.js:964)
    I20131231-01:51:09.001(8)?     at cursor.observeChanges.changed (packages/mongo-livedata/collection.js:237)
    I20131231-01:51:09.001(8)?     at packages/mongo-livedata/observe_multiplex.js:159
    I20131231-01:51:09.002(8)?     at Array.forEach (native)
    I20131231-01:51:09.002(8)?     at Function._.each._.forEach (packages/underscore/underscore.js:79)
    I20131231-01:51:09.010(8)?     at Object.task (packages/mongo-livedata/observe_multiplex.js:153)
    I20131231-01:51:09.010(8)?     at _.extend._run (packages/meteor/fiber_helpers.js:150)
    I20131231-01:51:09.010(8)?     at packages/meteor/fiber_helpers.js:128
    I20131231-01:51:09.010(8)? Exception in queued task: Error: Could not find element with id dsG5XJQcYE2opE8KT to change
    I20131231-01:51:09.011(8)?     at _.extend.changed (packages/livedata/livedata_server.js:176)
    I20131231-01:51:09.011(8)?     at _.extend.changed (packages/livedata/livedata_server.js:364)
    I20131231-01:51:09.011(8)?     at _.extend.changed (packages/livedata/livedata_server.js:964)
    I20131231-01:51:09.011(8)?     at cursor.observeChanges.changed (packages/mongo-livedata/collection.js:237)
    I20131231-01:51:09.011(8)?     at packages/mongo-livedata/observe_multiplex.js:159
    I20131231-01:51:09.011(8)?     at Array.forEach (native)
    I20131231-01:51:09.011(8)?     at Function._.each._.forEach (packages/underscore/underscore.js:79)
    I20131231-01:51:09.011(8)?     at Object.task (packages/mongo-livedata/observe_multiplex.js:153)
    I20131231-01:51:09.012(8)?     at _.extend._run (packages/meteor/fiber_helpers.js:150)
    I20131231-01:51:09.012(8)?     at packages/meteor/fiber_helpers.js:128
    

    how can i fix this?

    Multiple paginated collections per app

    Your module seems almost perfect, except that as the var name "Pages" is static, so it's not possible to have more than one pagination per app ?! Can you please confirm?

    Thanks.

    Detect missing collection

    Right now there is no check that the collection name passed to Paginate() exists. The error message is an unhelpful TypeError: Cannot read property '_name' of undefined at new Pages (packages/pages/paginate.coffee:4:22)

    Object #<Object> has no method 'setCollection'

    Just updated to 1.0.0. and getting this:

    TypeError: Object #<Object> has no method 'setCollection'
        at Object.Pages [as Pagination] (packages/pages\lib\pages.coffee:56:5)
    

    It's because I was using the old style, without new.

    pages & accounts-base

    Is it currently possible to limit the record set based on user authentication? Usually you would implement a publish callback and limit results based on the account (e.g., filter based on user roles, etc). Since Pages implements publish for you, you lose that ability it seems.

    Template helpers working improperly

    I added this package to my app and did all the necessary steps to set it up but when I added {{pages}} to my template instead of seeing my the items, I see:

    <$label:aqhvBif5Py9fCvz7k><$data:jPWMQ2PHqojPNnDaD><$landmark:Y3MDTAj3MKugcmEAh><$events:ocL9uZK7bSGtEquPK><$watch:Y7vg9kP3XA6i8Ftbc><$isolate:DFM4EPhLSyFjmc67a>

    </$isolate:DFM4EPhLSyFjmc67a></$watch:Y7vg9kP3XA6i8Ftbc></$events:ocL9uZK7bSGtEquPK></$landmark:Y3MDTAj3MKugcmEAh></$data:jPWMQ2PHqojPNnDaD></$label:aqhvBif5Py9fCvz7k>

    High Traffic makes the package go a little bit crazy

    You can see whats happening on this page. You'll notice that the page suddenly gets too heavy and entries on the table starts appearing everywhere, sometimes it doesn't show anything on the first page, sometimes it goes beyond the perPage config I set. What could be the problem? I am just using the code given from the table example.

    Meteor Pages doesn't recognize the collection helpers

    I've been using this plugin for displaying some of my collections. I use collection-helpers to add additional attributes to collections. However, Meteor-Pages doesn't recognize the helpers, while everything else in Meteor does.

    Here is the code that I am currently using. I had to make another template specifically for this plugin, because collection helpers aren't working. Here is the plugin that I am talking about https://github.com/dburles/meteor-collection-helpers

    And this is what the author of the plugin had to say about this: dburles/meteor-collection-helpers#11

    AnimePages = new Meteor.Pagination(Anime, {
        router: 'iron-router',
        routerTemplate: 'animeExplore',
        homeRoute: '/anime/explore/',
        route: '/anime/explore/page/',
        perPage: 30,
        itemTemplate: 'animeCardProxy',
        routerLayout: 'defaultLayout',
        sort: {canonicalTitle: 1},
        templateName: 'animeSpecificExplore',
        /*infiniteItemsLimit: 30,*/
    
    });
    
    <template name="animeExplore">
    
        {{> animeSpecificExplore}}
    
    </template>
    
    <template name="animeSpecificExplore">
    
    <div class="container main-content">
    
        {{> pagesNav}}
    
        <div class="row">
            {{> pages}}
        </div>
    
        {{> pagesNav}}
    
    </div>
    
    </template>
    

    Use only one collection for all paged collections

    The code creates a collection called pages_<collection_name>_data for each paged collection. Apparently, the only data in the collection is the number of pages. It would be nice to create just one collection, pages, to hold metadata about all paged collections.

    Crashing while running /server/ code

    Not sure if this is me being a moron and not understanding the package or if this is an actual issue..

    For instance,

    The documentation leads me to believe that you can configure Pages on either client or server side using the following:

    Pages.set
    perPage: 10
    sort:
    title: -1

    However, running this inside a /server/ folder produces the following error.

    W2046-00:41:29.214(0)? (STDERR) at app/server/server.coffee.js:4:3
    W2046-00:41:29.214(0)? (STDERR) at /home/action/workspace/pagetest/.meteor/local/build/programs/server/boot.js:154:10
    W2046-00:41:29.215(0)? (STDERR) at Array.forEach (native)
    W2046-00:41:29.215(0)? (STDERR) at Function..each..forEach (/home/action/.parts/packages/meteor/0.6.5.1/tools/0b2f28e18b/lib/node_modules/underscore/underscore.js:79:11)
    W2046-00:41:29.215(0)? (STDERR) at /home/action/workspace/pagetest/.meteor/local/build/programs/server/boot.js:81:5
    => Exited with code: 8
    => Your application is crashing. Waiting for file change.

    What is the proper method for defining server settings unavailable to the client?

    Thanks, sorry if I'm completely missing something.

    Missing dependency on "check" and "iron-router" package

    When using "pages" in a package, I'm getting an error in line 237 of "paginate.coffee": "ReferenceError: check is not defined" - same for "Router" (using setting "router: 'iron-router' ")
    Modifying the "use" section of "package.js" seems to fix it:

    api.use([
        "deps",
        "underscore",
        "coffeescript",
        "iron-router",
        "check"
    ], ["client", "server"]);
    
    api.use([
        "templating",
        "handlebars",
        "spark",
        "session",
    ], "client");
    

    Thanks for your effort, I'm looking forward to use infinite scrolling in my app. :)

    Never ending spinning wheel

    I an trying use meteor-pages and getting a never ending spinning (repetitively rendered) from {{{pages}}}. What's the best way to debug this? nothing reported on console...

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo 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.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.