Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.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
meteor:打开对话框后设置字段_Meteor_Sample - Fatal编程技术网

meteor:打开对话框后设置字段

meteor:打开对话框后设置字段,meteor,sample,Meteor,Sample,我正在努力完成派对演示 具有“编辑聚会”功能 我知道创建对话框在设置会话showCreateDialog时打开 {{#if showCreateDialog}} {{> createDialog}} {{/if}} 这显示了popin 但我想设置为字段后打开 我看不出在打开操作后如何操作?您可以在模板的内部设置操作DOM。但是如果你发现自己在这里写了很多粘合代码($(“#someInput”).val(“someVal”)),那么要小心,因为你可能走错了方向 Template

我正在努力完成派对演示 具有“编辑聚会”功能 我知道创建对话框在设置会话showCreateDialog时打开

{{#if showCreateDialog}}
    {{> createDialog}}
 {{/if}} 
这显示了popin 但我想设置为字段后打开
我看不出在打开操作后如何操作?

您可以在模板的内部设置操作DOM。但是如果你发现自己在这里写了很多粘合代码(
$(“#someInput”).val(“someVal”)
),那么要小心,因为你可能走错了方向

Template.createDialog.rendered = function() {
    // you can manipulate the DOM here
}
请记住,您可以将字段值绑定到实例,因此下面类似的内容将自动绑定您的对象

<template name="editDialog">
    {{#with party}}
        <input type="text" id="myPartyName" value="{{name}}" />
        ...
    {{/with}}
</template>

Template.editDialog.party = function() {
    return Parties.findOne(Session.get("selectedParty"));
};

{{{与政党}
...
{{/与}}
Template.editDialog.party=函数(){
返回Parties.findOne(Session.get(“selectedParty”);
};