简体   繁体   中英

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() ,因此,您刚插入的文档不包括在光标中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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