aslagle / reactive-table

A reactive table designed for Meteor
https://atmospherejs.com/aslagle/reactive-table
Other
328 stars 137 forks source link

eactiveTable error: argument is not an instance of Mongo.Collection, a cursor, or an array #420

Open MMrj9 opened 8 years ago

MMrj9 commented 8 years ago

I'm getting the following error: "reactiveTable error: argument is not an instance of Mongo.Collection, a cursor, or an array" And i'm not understanding why, any help would be appreciated.

//Publish
Meteor.publish('event', function() {
  return Event.find({ });
});

//eventlist.js
Template.eventlist.onCreated(function() {
    var self = this;
    self.autorun(function() {
        self.subscribe('event');
    });
});

Template.eventlist.helpers({
    event: function() {
        return event;
    },
    listSettings: function() {
        return {
            rowsPerPage: 10,
            fields: [{
                key: 'id',
                label: 'Id'
            }, {
                key: 'name',
                label: 'Name'
            }]
        }
    }
});

//eventlist.html
<template name="eventlist">
    {{> reactiveTable collection=event settings=listSettings}}
</template>
aslagle commented 8 years ago

Looks like your event helper needs to return Event, not event - that's the Collection.