【发布时间】:2016-03-26 05:43:09
【问题描述】:
自动表单仅记录一个适用于所有 jobOffers 的接受/拒绝。在 {{#each}} 语句中时,doc=this 不是指单个 jobOffer。
路径:Schema.js
Schemas.Offers = new SimpleSchema({
offer: {
type: String,
optional: true,
allowedValues: ['Accept', 'Reject'],
autoform: {
type: "select-radio",
options: function () {
return [
{label: "Accept", value: 'Accept' },
{label: "Reject", value: 'Reject' },
];
}
}
}
});
路径:template.html
{{#each jobOffers}}
{{#autoForm collection="Offers" id="offerForm" doc=this type="update" autosave=true}}
{{> afQuickField name="offer" type="select-radio" template="buttonGroup" label=false}}
{{/autoForm}}
{{/each}}
【问题讨论】: