Hi i have a cfoutput to loop a query and i'm using dynamic variables to display the layout in client's side, every works fine except for the binding that only works when i'm not using jquery's modal.
there's my coldfusion code
<cfoutput query = "RSSelect.rs">
<div id="editar_#idu_programa_detalle#" title="Editar">
<table>
<tr>
<td align="right" valign="middle">Estado:</td>
<td align="left" valign="middle">
<cfselect
title="id_Estado"
selected="#RSSelect.RS.idu_estado_salida#"
id="idu_estado_salida_#idu_programa_detalle#"
name="idu_estado_salida_#idu_programa_detalle#"
query="RSEstados.RS"
display="nb_Estado"
value="id_Estado"
queryPosition="below"
style="width:200px"
required="yes"
message="El estado es requerido"
>
<option value="0" >Seleccione estado </option>
</cfselect>
</td>
<td align="left" valign="middle">Ciudad:
<cfselect
title="Seleccione ciudad"
selected="#RSSelect.RS.idu_ciudad_salida#"
name="idu_ciudad_salida_#idu_programa_detalle#"
id="idu_ciudad_salida_#idu_programa_detalle#"
bind="cfc:#Application.CfcPath#.solicitudes_cm_uo.obtenerCiudades({idu_estado_salida_#idu_programa_detalle#@change})"
bindonload="yes"
value="id_Ciudad"
display="nb_Ciudad"
queryPosition="below"
style="width:200px"
required="yes"
message="El campo ciudad no debe de quedar vacio"
>
</cfselect>
</td>
</tr>
</table>
</div>
</cfoutput>
and jquery code
<link rel="stylesheet" href="../css/smoothness/jquery-ui.css" />
<script src="../js/jquery-1.9.1.js"></script>
<script src="../js/jquery-ui.js"></script>
<cfoutput query = "RSSelect.rs">
<script>
$(function()
{
$( "##editar_#idu_programa_detalle#" ).dialog(
{
modal:true,
autoOpen: false,
height:999,
width:999,
buttons:
{
"Editar": function()
{
alert('se edito correctamente');
$( this ).dialog( "close" );
},
"Cancelar": function()
{
alert('se cancelo correctamente');
$( this ).dialog( "close" );
}
}
});
});
</script>
</cfoutput>
I'd apreciate your help.
I tried using showmodaldialog as well but it only works on IE
any other options using a modal dialog would be ok.
Basically a call a function to open the modal dialog.
Well i think I coded too much but here it is =).
<script language="javascript">
function OpenPop(idu_programa,idu_programa_detalle)
{
var x = false;
//alert('algo');
x = showModalDialog('pop_editar_detalle_supervision.cfm?idu_programa='+idu_programa+'&idu_programa_detalle='+idu_programa_detalle,'dialogHeight:1000px;dialogWidth:1000px;');
if (typeof x == 'undefined')
{
alert('Edicion cancelada');
}
else
{
document.getElementById('idu_programa_detalle_pop').value = idu_programa_detalle
document.getElementById('idu_estado_salida_pop').value = x[0];
document.getElementById('idu_ciudad_salida_pop').value = x[1];
document.getElementById('fec_salida_pop').value = x[2];
document.getElementById('opc_meridiano_salida_pop').value = x[3];
document.getElementById('fec_supervision_inicial_pop').value = x[4];
document.getElementById('fec_supervision_final_pop').value = x[5];
document.getElementById('opc_meridiano_supervision_inicio_pop').value = x[6];
document.getElementById('form1').submit();
}
}
</script>
Then I returned the values on an array then i put the values on hidden inputs to call them after submit
Here is the modal javascript code that returns the array.
<script language="javascript">
function Editar()
{
var valoresDevueltos = new Array();
valoresDevueltos[0] = document.getElementById('idu_estado_salida').value;
valoresDevueltos[1] = document.getElementById('idu_ciudad_salida').value;
valoresDevueltos[2] = document.getElementById('fec_salida').value;
if(document.getElementById('amSalida').checked)
{
valoresDevueltos[3] = document.getElementById('amSalida').value;
}
else
{
valoresDevueltos[3] = document.getElementById('pmSalida').value;
}
valoresDevueltos[4] = document.getElementById('fec_supervision_inicial').value;
valoresDevueltos[5] = document.getElementById('fec_supervision_final').value;
//Checking which radioButton is checked
if(document.getElementById('amSupervision').checked)
{
valoresDevueltos[6] = document.getElementById('amSupervision').value;
}
else
{
valoresDevueltos[6] = document.getElementById('pmSupervision').value;
}
window.returnValue = valoresDevueltos;
window.close();
}
</script>
Hope it is clear enough if not let me know to improve my answer thank you for your patience =)