Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/04/2013, 10:04
chcma
 
Fecha de Ingreso: junio-2003
Ubicación: Asturias
Mensajes: 2.429
Antigüedad: 20 años, 11 meses
Puntos: 7
Respuesta: knockout - Jquery... Saber que fila poner en modo Edicion...

Código:
<tbody data-bind="foreach: CertificationList">
	<tr>
		<td>
			<lable style='display: inline' type='text' id='lblEdicion' data-bind='text: Name'></label>
			<input style='display: none' type='text' id='txtEdicion' data-bind='text: Name' />
		</td>
		<td>
			<input type='button' id='btnEdicion' value='Editar' />
		</td>
	</tr>
</tbody>
Supongamos que este código anterior genera algo similar a esto

Código:
<table>
	<tr>
		<td>
			<lable style='display: inline' id='lblEdicion'>Un Valor Cualquiera</label>
			<input style='display: none' type='text' id='txtEdicion' value='Un Valor Cualquiera' />
		</td>
		<td>
			<input type='button' id='btnEdicion' value='Editar' />
		</td>
	</tr>
	<tr>
		<td>
			<lable style='display: inline' id='lblEdicion'>Otro Valor</label>
			<input style='display: none' type='text' id='txtEdicion' value='Otro Valor' />
		</td>
		<td>
			<input type='button' id='btnEdicion' value='Editar' />
		</td>
	</tr>
</table>
Bien, la idea entonces es, que dependiendo de que botón Editar se pulse, me cambie los display de los controles para la fila correspondiente a la que se encuentra el botón. Espero haberme explicado mejor ahora. : )
__________________
Charlie.