I have a grid displayed on a page where each “box” may or may not have an value assigned in the db. So when I’m rendering the page, I would like to selectively assign db rows where a db document exist for that specific “box”.
Can you explain the bit where the “TAKEN” boxes have documents assigned to them?
Do you want to have one database, with records that have a ‘take’ property which can either be true or false? If ‘taken’ is true, what data are you wanting to display?
selectively assign db rows where a db document exist for that specific “box”.
Do you want the grid to represent the whole collection, each box to represent each document in the collection, then get the value from the document and display it?
You can count how many records are in the collection, then use that to loop through its contents to create the box…
Have you done much in meteor yet? I would recommend looking at the meteor tips tutorial (http://meteortips.com/first-meteor-tutorial/) - it covers a lot of good ground which you will be able to use in a game like this…
well, you can just represent it as array of objects and than #each over them.
If you set in CSS for example 33.3% as width for each of them, u will get 3 per line.
Or you can also go with array of arrays if u find it easier to process and than something like
{{#each wholeArray}}
{{#each this}}
{{#if taken}}
TAKEN
{{else}}
TAKE
{{/if}}
{{/each}}
{{/each}}