[英]Meteor helper of template not firing when data changes?
我在客户端有以下内容:
Template.cellular.helpers({
getCells: function() {
console.log("getting cell list");
things = cellItems.find({owner: Meteor.userId(), FileId: "someId"});
console.log(things);
return things;
}
});
<template name="cellular">
<div id='cellPane'>
<div id='data'>
{{#each getCells}}
<div id="{{_id}}" >
<div class='celldesc' contenteditable="true" display="block">
{{description}}
</div>
<div class='cellval' contenteditable="true" display="block">
{{vals}}
</div>
<div class='cellformula' contenteditable="true" display="block">
{{formula}}
</div>
</div>
{{/each}}
</div>
</div>
</template>
当我插入以下内容时,似乎没有激发显示控制台语句的帮助程序,但是我看到正在更新然后删除的模板闪烁。 怎么了? 我该如何纠正?
{owner: Meteor.userId(), FileId: "someId", description: "something", vals: "0", formula: "something else"}
您正在添加具有FileId: "someId"
的文档,但是您的助手正在dynaFileId: "someId"
上执行find()
,因此,您刚插入的文档不包括在光标中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.