【发布时间】:2018-04-17 17:50:24
【问题描述】:
我是流星新手,我想创建一个表单,其中一个字段的值决定自动表单中另一个字段的值。让我们将设置类型设为“A”、“B”和“C”,因此当我选择“A”时,将加载一个自动表单。我已将此表单设为通用,即它将为所有 A、B 和 C 显示。
{{#each users}}
{{> afQuickField name='userEmail' value=userEmail readOnly=true }}
{{> afQuickField name='Setup' value=type readOnly=true}}
{{> afQuickField name='Profile' options='allowed' }}
{{> afQuickField name='Purpose' }}
{{> afQuickField name='count' options='allowed' }}
{{> afQuickField name='PackageDirectory' options='allowed' }}
{{> afQuickField name="logName" options=LogName }}
{{/each}}
计数选项应该是:
1. 对于“A”,计数选项应为 9、11、12。
2. 对于“B”,它是 1。
3. 对于“C”,它是 5。
在架构中,我编写了这样的代码
Setup:{
type: String,
label:"Setup",
optional:false,
defaultValue:type
},
count:{
type: String,
label:"No. Of count",
optional: true,
allowedValues:["9","11","12"],
autoform:{
afFieldInput:{
firstOption:"(Select the count)"
}
}
}
因此,当我选择设置“A”时,我应该获得三个下拉选项,当我单击“B”和“C”时,我应该分别获得默认值 1 和 5。 谁能解决我的问题?
【问题讨论】:
标签: javascript node.js meteor mongoose-schema meteor-autoform