在模板助手中获取异常:带有aldeed:autoform的quickFormContext [英] Getting Exception in template helper: quickFormContext with aldeed:autoform

查看:83
本文介绍了在模板助手中获取异常:带有aldeed:autoform的quickFormContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到 aldeed:autoform 遇到的问题,但我也无法解决了解是什么原因.模板:

I'm having an issue with aldeed:autoform which I can't solve, nor understand what is the cause. The template:

<template name="staffCaseEdit">
  {{> quickForm collection=Cases id="inserNewItem" type="insert"}}
</template>

我使用 aldeed:collection2

I use aldeed:collection2 and aldeed:simple-schema to manage collections. So, I have the Case schema and Cases collection, both defined in /lib so they should be available on the client side, too.

接下来,有路线:

FlowRouter.route('/staff/case/:id', {
    triggersEnter: [
        AccountsTemplates.ensureSignedIn
    ],
    subscriptions: function (params) {
        this.register('theCase', Meteor.subscribe('theCase', params.id));
    },
    action: function (params, queryParams) {
        return BlazeLayout.render('container', {
            main: 'staffCaseEdit',
            id: params.id
        });
    }
});

当然,theCase已发布:

Meteor.publish('theCase', function (id) {
    return Cases.find({
        id: Number(id)
    });
});

在浏览器控制台中,存在案例:

In browser console, Cases are present:

> Cases
< Object

> Cases.find().count()
< 1

我建议足以使quickForm正确使用集合(它需要一个作为参数之一).

Which I suggest to be sufficient for the quickForm to consume the collection properly (it requires one as one of the arguments).

问题是,在客户端,我遇到了错误

The problem is that, on the client side, I'm having an error

Exception in template helper: quickFormContext@http://localhost:3000/packages/aldeed_autoform.js?b0918af3b0bb0ae387d80c71f4230daca94cae11:6851:34

我无法追踪的

.结果,没有显示任何表单(实际上,整个DOM都留空了.

which I cannot trace. As a result, no form is being shown (actually, the whole DOM is left empty.

我应该找什么?这个特殊问题的根源可能是什么?

What should I look for? What could be the source of this particular problem?

推荐答案

这里有些黑暗,我不知道它是否能解决您的问题,但肯定会有所帮助...使用此:

A bit shooting in the dark here, I don't know if it will fix your problem but it will certainly help... Use this:

<template name="staffCaseEdit">
  {{> quickForm collection="Cases" id="inserNewItem" type="insert"}}
</template>

您要将变量Cases传递给集合参数,而不是将其传递给目标集合"Cases"

You are passing the variable Cases to the collection parameter instead of passing it the name of the target collection "Cases"

这篇关于在模板助手中获取异常:带有aldeed:autoform的quickFormContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆