Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MeteorJS更新自动表单未加载文档_Meteor - Fatal编程技术网

MeteorJS更新自动表单未加载文档

MeteorJS更新自动表单未加载文档,meteor,Meteor,我有一个带有更新自动表单的模板: <template name = "editLocationPage"> <div class="flow-text"> {{#if Template.subscriptionsReady}} <div> <br> {{#autoForm collection="Locations" doc=currentDoc id="editLocationPage" t

我有一个带有更新自动表单的模板:

<template name = "editLocationPage">
    <div class="flow-text">
      {{#if Template.subscriptionsReady}}
      <div>
      <br>
      {{#autoForm collection="Locations" doc=currentDoc id="editLocationPage" type="update"}}
         <fieldset>
           {{testDoc}}
           <legend>Edit Location / Asset</legend>
           {{> afQuickField name='id'}}
           {{> afQuickField name='text'}}
           {{> afQuickField name='description' rows=3}}
           {{> afQuickField name='type'}}
           {{> afQuickField name='parent'}}
         </fieldset>
         <button type="submit" class="btn waves-effect waves-light">Submit</button>
         <button type="reset" class="btn waves-effect waves-light red">Reset</button>
       {{/autoForm}}
     </div>
     {{/if}}
    </div>
</template>
模式:

// Data subset subscribed to on client
Meteor.publish('locations', function() {
  return Locations.find({}, {fields: {
    text: true,
    id: true,
    type:true,
    parent:true
  }});
});

Meteor.publish('singleLocation', function(locationId) {
  return Locations.find({id:locationId});
});

文档正常(findOne返回有效的文档),但表单不工作。有什么想法吗?

我刚发现问题所在。我需要添加模式:

{{#autoForm schema=locationFormSchema id="editLocationPage" type="update" collection=Locations doc=currentDoc}}
与助手一起:

Template.editLocationPage.helpers({
  currentDoc: function() {
    return Locations.findOne({"id":Session.get("idTreeView").toString()});
  },
  locationFormSchema: function() {
    return Schema.locations;
  }
});

我刚刚发现了问题。我需要添加模式:

{{#autoForm schema=locationFormSchema id="editLocationPage" type="update" collection=Locations doc=currentDoc}}
与助手一起:

Template.editLocationPage.helpers({
  currentDoc: function() {
    return Locations.findOne({"id":Session.get("idTreeView").toString()});
  },
  locationFormSchema: function() {
    return Schema.locations;
  }
});

控制台中有任何错误吗?debug.js:41模板帮助程序中的异常:TypeError:无法读取bindDataContext()上未定义的Object.afFieldInputContext()的属性“label”。。。。。。。。。。。。之后是异常页面也尝试传递此消息,但没有成功:Locations.find({“id”:Session.get(“idTreeView”).toString()).fetch()[0]控制台中有任何错误吗?debug.js:41模板帮助程序中的异常:TypeError:无法读取bindDataContext()中未定义的对象的属性'label'。。。。。。。。。。。。后面是异常页面也尝试了传递它,但没有成功:Locations.find({“id”:Session.get(“idTreeView”).toString()}.fetch()[0]对不起,输入错误。更改位置集合定义:{{{#autoForm schema=locationFormSchema id=“editLocationPage”type=“update”collection=“Locations”doc=currentDoc}}对不起,输入错误。更改位置集合定义:{{{#autoForm schema=locationFormSchema id=“editLocationPage”type=“update”collection=“Locations”doc=currentDoc}}