简体   繁体   English

数据更改时模板的流星助手不触发?

[英]Meteor helper of template not firing when data changes?

I have the following on my client side: 我在客户端有以下内容:

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>

When I insert the following, it does not seem to fire the helper showing the console statement but I see flicker of the template being updated and then removed. 当我插入以下内容时,似乎没有激发显示控制台语句的帮助程序,但是我看到正在更新然后删除的模板闪烁。 What is happening? 怎么了? How can i correct it? 我该如何纠正?

{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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM