【问题标题】:Meteor bootstrap datetimepicker throwing errors and positioned incorrectlyMeteor bootstrap datetimepicker 抛出错误并定位不正确
【发布时间】:2015-05-01 13:37:57
【问题描述】:

当我使用autoform bootstrap datepicker 时,我在下面的屏幕截图中遇到了以下错误和定位。

错误:

2meteor.js:887 来自 Tracker afterFlush 函数的异常:未定义不是函数 类型错误:未定义不是函数 在空。 (http://localhost:3000/packages/aldeed_autoform-bs-datetimepicker.js?279246d1cf7d4b5603ac030d7466e9bc6e5ac0d1:171:11)

这是我的代码:

包:

aldeed:autoform                     # Auto create forms with validations from schema (Uses bootstrap by default).
twbs:bootstrap                      # Bootstrap.
tsega:bootstrap3-datetimepicker     # Bootstrap datetime picker.
aldeed:autoform-bs-datetimepicker   # Add datetime picker to autoform.

架构:

   start:
      type: Date
      label: 'Start'
      autoform:
         type: 'bootstrap-datetimepicker'
   end:
      type: Date
      label: 'End'
      autoform:
         type: 'bootstrap-datetimepicker'

表格:

   +autoForm(collection='Events' id='insertEventForm' type='insert')
      fieldset
         legend Add an event
         +afQuickField(name='start')
         +afQuickField(name='end')
         +afQuickField(name='assignedToId')
      button.btn.btn-primary(type='submit') Submit

如果有人能告诉我我错过了什么,我将不胜感激。

【问题讨论】:

  • 我不确定,但我记得一旦我在控制台中出现错误,我只需要指定最新版本的软件包。也许是这样。
  • 谢谢@Mário。我尝试更新所有内容,但仍然遇到同样的问题。

标签: meteor bootstrap-datepicker meteor-autoform


【解决方案1】:

你需要一个围绕控件的容器 div

<body>
   <div class="container">
      <div class="row">
          <div class="col-md-6">
              your code snippet here
          </div>
      </div>
   </div>
</body>

【讨论】:

  • 非常感谢。这固定了定位。不过,我仍然遇到流星错误。他们仍然阻止表单提交。
  • "undefined is not a function" 不是很有帮助,因为这个错误可能来自任何地方,你可以把你的代码放在github或meteorpad上调试吗?
  • 我同意。对于那个很抱歉。如果我想不出来,我会把它放在 Meteorpad 上。
  • 好吧,祝你好运,如果你想让我稍后在流星板上调试,请告诉我
  • 会的。再次感谢。
猜你喜欢
  • 1970-01-01
  • 2016-03-28
  • 1970-01-01
  • 2016-12-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-23
  • 2014-01-27
相关资源
最近更新 更多