aslagle / reactive-table

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

Server-side Pagination and Filtering #362

Closed sakshi-kataria closed 8 years ago

sakshi-kataria commented 8 years ago

Events = new Mongo.Collection('events'); ReactiveTable.publish( "events", Events ); {{> reactiveTable collection=events settings=tableSettingsTerminals class="table table-bordered table-hover"}}

Template.exportTerminalsInfo1.helpers({ tableSettingsTerminals() { return { rowsPerPage: 20, showFilter:false, fields: [ {key: 'time', label: 'Date/Time',sortOrder: 0, sortDirection: 'descending', fn: function (value, object) { var val= getDateString(new Date(value ), "d MM, y h:m:s:S"); return val; }}, {key: 'action', label: 'Action', sortOrder: 1, sortDirection: 'ascending'}, { key: 'terminalId', label: 'Terminal Address', sortOrder: 1, sortDirection: 'ascending', fn: function (value, object) { var _terminal= Terminals.findOne(value); return ${_terminal.number} - ${_terminal.city}, ${_terminal.address}; } }] }; } }); Server side pagination is not working please help me if you have any solution

sakshi-kataria commented 8 years ago

if at console i am writing Events.find({}).fetch() data is not coming..

aslagle commented 8 years ago

You need

{{> reactiveTable collection="events" settings=tableSettingsTerminals class="table table-bordered table-hover"}}

with quotes around events.

sakshi-kataria commented 8 years ago

thanks its now working