[英]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.