aslagle / reactive-table

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

reactiveTable error: fields option is required with server-side publications #485

Open theavijitsarkar opened 6 years ago

theavijitsarkar commented 6 years ago

I tried to publish a basic collection and show it on the UI, but I get an error. I tried adding fields but that doesn't solve anything.

/client/dashboard.html

{{> reactiveTable collection="attendance_dashboard_table"}}

/server/publish.js

//Attempt 1
ReactiveTable.publish("attendance_dashboard_table", Attendance_dashboard);
//Attempt 2 
ReactiveTable.publish("attendance_dashboard_table", Attendance_dashboard, function(){
    return {owner: this.userId}
}, {fields: {owner:0}});

Error

reactiveTable error: fields option is required with server-side publications
aslagle commented 6 years ago

The fields option is required on the client, not on the server. So you'll need to pass in fields when you create the table in your template.