reactive-table icon indicating copy to clipboard operation
reactive-table copied to clipboard

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

Open theavijitsarkar opened this issue 7 years ago • 1 comments

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

theavijitsarkar avatar Feb 09 '18 11:02 theavijitsarkar

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.

aslagle avatar Feb 09 '18 16:02 aslagle