问题
I am having some difficulty getting an autoform to save. This is a new issue for me; so I am a little unsure on how to fix it.
I have the following form:
<template name="TaskItems">
{{#if inspectionMode}}
<a href="#" class="inspection btn btn-danger">Close Task <i class="glyphicon glyphicon-minus"></i></a>
<table class="table table-striped">
<thead>
<tr>
<th>Facility Section</th>
<th>Title</th>
<th>Section</th>
<th>Code</th>
<th>Pass/Fail</th>
</tr>
</thead>
<tbody>
{{#each TaskItem}}
<tr>
<td>{{DataFacilitySection}}</td>
<td>{{DataItemDescription}}</td>
<td>{{DataItemSection}}</td>
<td>{{DataItemCode}}</td>
<td>
{{#autoForm id=itemUpdateForm collection="ClientData" type="update" autosave=true template="custom" doc=this}}
{{> afFormGroup name="DataItemPass" label=false}}
{{/autoForm}}
</td>
</tr>
{{/each}}
</tbody>
</table>
{{else}}
<a href="#" class="inspection btn btn-success">Begin Task <i class="glyphicon glyphicon-pencil"></i></a>
{{/if}}
</template>
The id logic is here:
itemUpdateForm: function() {
return Template.parentData(2)._id;
},
I did add SimpleSchema.debug = true;
and it gives the following error:
SimpleSchema.clean: filtered out value that would have affected key "DataItemPass", which is not allowed by the schema
The field is pulling in the correct data (the field is filled out) but when I click off the field it does not save. I tried adding a submit button to see if that may change things, but it had no effect.
I can add the schema to the post if that is helpful. Any suggestions would be most appreciated!
来源:https://stackoverflow.com/questions/41646401/autoform-update-not-working