如何使用autoform显示选项

时间:2015-07-21 08:23:19

标签: meteor meteor-blaze meteor-autoform meteor-helper meteor-collection2

我已经为我的架构添加了选项,但autofrom没有显示选项。

我的架构:

BetaSignups = new Mongo.Collection("BetaSignups");

BetaSignups.attachSchema(new SimpleSchema({
  segment: {
    type: String,
    label: "Segmento",
    allowedValues: ["college", "highschool", "professional"],
    autoform: {
      options: [
        {label: "Ensino superior", value: "college"},
        {label: "Ensino médio e pré-vestibular", value: "highschool"},
        {label: "Educação profissional", value: "professional"}
      ]
    }
  },
  name: {
    type: String,
    label: "Nome",
    max: 200
  }, ...

我在表格中添加了:

<template name="insertbetasignups">
  {{> quickForm collection="BetaSignups" id="insertbetasignups" type="insert"}}
</template>

缺少选项,它只显示标签: enter image description here

我使用以下套餐:

meteor-platform
materialize:materialize
aldeed:collection2
alanning:roles
coffeescript
meteorhacks:flow-router
tap:i18n
aldeed:autoform
ongoworks:security

我添加了一个server / security.js文件:

BetaSignups.permit(['insert']).apply();

1 个答案:

答案 0 :(得分:0)

错误在我的设置中,我忘了将此js添加到客户端lib以配置autoform-materialize包。

<ItemTemplate>
    <%#(Eval("type") == "video" ? RenderVideo(((System.Data.DataRowView)GetDataItem()).Row) : "") %>
    <%#(Eval("type") == "photo" ? RenderPhoto(((System.Data.DataRowView)GetDataItem()).Row) : "") %>
</ItemTemplate>