我试图将变量从modal变为另一个模态,这是mi模态:
<div id="contentModal" class="modal fade" >
<div class="modal-content animate" tabindex="-1">
<div class="modal-container-">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h1>Issue: {{selected_issue.Issue}}</h1>
</div>
<div class="modal-body row">
<div class="col-md-5">
<h5 style="text-align: center;">Descripción</h5>
<p1>{{selected_issue.Descripcion}}</p1>
</div>
<div class="col-md-5">
<h5 style="text-align: center;">Solución</h5>
<p1>{{selected_issue.Solucion}}</p1>
</div>
<div id="modalSpec"class="col-md-2">
<h6>OpCo:</h6>
<p1>{{selected_issue.opCo}}</p1>
<h6>Tecnologia:</h6>
<p1>{{selected_issue.Tecnology}}</p1>
<h6>Version:</h6>
<p1>{{selected_issue.Version}}</p1>
<h6>Estado:</h6>
<p1>{{selected_issue.Status}}</p1>
<h6>Autor:</h6>
<p1>{{selected_issue.Autor}}</p1>
<p1>{{id}}</p1>
<div>
<h6>Editar:</h6>
<select name='type' id='type'>
<option value="" disabled selected>Seleccionar</option>
<option value='OpCo' >Descripción</option>
<option value='Solucion' >Solución</option>
<option value='Estado' >Estado</option>
</select>
<div><button id"modalClose" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button></div>
</div>
</div>
</div>
</div>
</div>
<script>
$("#type").on("change", function () {
$modal = $('#secondModal');
if($(this).val() === 'OpCo'){
$modal.modal('show');
$('#type').val('');
}
});
</script>
</div>
如代码所示,触发第二个模态的脚本位于第一个模态内。无论何时从下拉菜单中选择某个内容,模态弹出,但我不知道如何传递变量,例如{{selected_issue .Descripcion}},我也想知道如何从数组中传递$ index值。
非常感谢大家。