Hi,
I’m having troubles of using aldeed:tabular.
I’m following the example of this page : https://atmospherejs.com/aldeed/tabular
I completed it with my mongo collection, but there is no data showing up ! I got a Processing popup and that’s it.
Here is some code :
Everything looks okay to me in your snippet. That being said, is this the majority of your code? If not can you post your full JS/HTML files? I just want to make sure there isn’t something else interfering. Please also confirm that your Books (default.players) collection exists and has data in Mongo.
I tried an other component : the aslagle:reactive-table
It is even easier than tabular and seems to be perfect for my usage. So I tried to play with… but the table still empty !
I asked myself if my collection returned right the elements, so I did an manual find to print some content, and it works ! So why in this table, there is nothing ?!
I’m pretty sure now the problem is the same than with tabular ! Am I dummy or what ?
html code :
<head>
<title>testReactiveTable</title>
</head>
<body>
<h1>Here is my players !</h1>
{{> myTemplate}}
</body>
<template name="myTemplate">
{{> reactiveTable collection=default.players rowsPerPage=5}} // the real name of my collection
{{> reactiveTable collection=Players rowsPerPage=5}} // to hit directly on the new Mongo.Collection('default.players') element !
<p>test bellow</p>
{{#each records }}
<p>name : {{name}} - score : {{score}}</p>
{{/each}}
<p>end of test</p>
</template>
js code
Players = new Mongo.Collection('default.players'); // runs on both client and server
if (Meteor.isClient) {
Template.myTemplate.onCreated(function () {
Meteor.subscribe("default.players");
});
Template.registerHelper('records', function (user) {
return Players.find({});
});
Template.myTemplate.helpers({
players: function () {
return Players.find();
}
});
}
if (Meteor.isServer) {
Meteor.publish("default.players", function publishFunction() {
return Players.find();
});
}
b) Based on the code you’re showing reactive-table won’t be able to get the fields list (check your browser console for errors). Add/change the following:
the both didn’t shown anything yesterday, but today they worked properly !
So yep, reactiveTable doesn’t understand the default.players table (which is the real db’s name). This should be working reading the doc…
But it understands the plug with helpers players and records .