I have schema similar to this:
Schema.Adviser = new SimpleSchema({
"firstName": {
type: String
}
});
Schema.Orders = new SimpleSchema({
"adviserId": {
type: Object
},
"period": {
type: Date
},
"order": {
type: Number,
min: 0
}
});
I need to render a table like this:
first name | January | February
Bob | 1 | 0
Bill | 0 | 1
Each value is an input field that is editable.
If for example there is no order record for Bob in January I need January to still render, ideally with a 0 such that someone can add a January order.
Something like this:
months is an array of months to be shown. Each follows the format: Mon Feb 01 2016 00:00:00 GMT+0000
{{#each month in months}}
{{#each getOrders}}
{{#if equals month period}}{{order}}{{/else}}0{{/if}}
{{/each}}
{{/each}}
Not only can I not get this to work, but before spending much more time trying to debug the issue I'm wondering if this is really the best way to do this.
Any advice?
Many thanks