meteor - 如何对 [Object] 数组的每个单独元素使用 {{#autoForm}}?

标签 meteor meteor-autoform

我想做一些与这个问题非常相似的事情:Meteor: Custom AutoForm with array of objects

也就是说,我想手动布局数组的每个元素中的每个字段。

不同的是,我仍然想使用 afArrayField 及其默认模板,包括添加和删除数组项的按钮。我只想将我自己的布局传递给 afArrayField。我该怎么做?

如果我没有说清楚,请要求澄清,我会重新措辞。

最佳答案

您可能需要创建一个自定义模板(文档:https://github.com/aldeed/meteor-autoform#creating-a-custom-template)。

你可以做类似的事情(未经测试):

<template name="your_template">
    {{# autoForm [...]}}
        [...]
        {{> afQuickField name="players" template="custom_players"}}
        [...]
    {{/autoForm}}
</template>

<template name="afArrayField_custom_players">
    your custom template for players field
</template>

您还可以查看默认的 afArrayField 模板来激发自己:

关于meteor - 如何对 [Object] 数组的每个单独元素使用 {{#autoForm}}?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31055550/

相关文章:

javascript - meteor 读数 csv 文件 Papa Parse

javascript - 获取autoform非集合表单方法返回值

javascript - Meteor 快速表单未提交

Meteor autoform 删除星号表单单选选项

mongodb - Meteor new Date() 对 mongodb 3.0.1 和 autoform/simple 模式无效

javascript - 同一模板内多次触发事件

javascript - 在 Meteor 中使用 Jquery 的按钮事件问题?

javascript - 在 Meteor Mongo 中寻找值(value)

javascript - 更新 Meteor.js 中的帖子

javascript - 如何更新 meteor 中的自动表单字段