如何设置'选择'列表中的模态对话框-流星
How to set 'select' list in a modal dialog - Meteor?
当我在模态对话框中添加'Edit'功能时,我设法设置了文本值。但是下拉的选择列表没有更新。
<template name="edit_deal">
<button id="edit_btn" class="edit">Edit</button>
<div id="edit_dialog" title="Edit opportunity">
{{> Edit }}
</div>
</template>
<template name="Edit">
<form class="edit-deal">
<select name="quarter">
<option value="1">Q1</option>
<option value="2">Q2</option>
<option value="3">Q3</option>
<option value="4">Q4</option>
</select>
<input type="text" name="cuname" placeholder="Customer Name" >
</form>
</template>
.js
Template.edit_deal.events({
'click #edit_btn': function(event, template) {
$( "#edit_dialog" ).dialog('open');
Deals.find({"_id" : this._id}).fetch();
$('input[name="quarter"]').val(this.quarter);
$('input[name="cuname"]').val(this.customerName);
}
});
当"编辑"模式对话框弹出时,除了"选择"列表外,所有值都会更新。缺少了什么?谢谢你!
您正在搜索这样的输入标记:
$('input[name="quarter"]').val(this.quarter);
查找select:
$('select[name="quarter"]').val(this.quarter);
相关文章:
- 使用模态对话框(JQuery)编辑函数
- jquery模态对话框通过id获取输入类型text的值
- ASP.net按钮单击时不使用Jquery模态对话框激发
- jBox模态对话框Created监听器函数从第二次开始就不起作用了
- 模态对话框与指令在角度,范围问题
- 模态对话框加载 jquery 在控制台中执行,但不从应用程序加载.js
- 我怎样才能用javascript找出模态对话框的宽度和高度
- 在模态对话框中按键事件
- 带有 D3 图的引导模态对话框
- 跨浏览器显示模态对话框替换
- 基于Ionic和AngularJS的模态对话框导致应用程序冻结
- AngularJS 模态对话框表单对象在控制器中未定义
- 引导 3 - 模态背景不会根据模态对话框的高度调整大小
- jqGrid SetCell 和 SaveCell 在关闭模态对话框后将单元格清空
- jqueryUI 模态对话框会破坏 Knockoutjs 绑定
- Webdriver 为模态对话框(这是覆盖)抛出 Nosuchemelent 异常
- 如何在加载网站主页时加载模态对话框
- 如何使用jQuery在模态对话框中访问id
- 如何在jsf-dataTable中调用j-query模态对话框
- 为什么我'在关闭第一模态对话框之后,m不能显示第二模态对话框