Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/08/2014, 12:46
Avatar de thedenis
thedenis
 
Fecha de Ingreso: mayo-2013
Mensajes: 42
Antigüedad: 11 años
Puntos: 1
Pregunta Como Actulizar datos en filas de una tabla

Hola a todos

Tengo el siguiente problema, tengo dos filas y cuando actulizo la cantidad en una fila se actualiza tambien en la otra fila..

Como puedo hacer para que la actulizacion sea individual por cada fila ?

Aca les dejo el codigo completo :

Código:
<html>
<head>
<title></title>
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>


<script type="text/javascript">


var inicio=function () {
	$(".cantidad").keyup(function(e){
		if($(this).val()!=''){
			if(e.keyCode==13){
				var id=$(this).attr('data-id');
				var precio=$(this).attr('data-precio');
				var cantidad=$(this).val();
				$(this).parentsUntil('.productouni').find('.subtotal').text('Subtotal: '+(precio*cantidad));
				$.post('./js/modificarDatos.php',{
					Id:id,
					Precio:precio,
					Cantidad:cantidad
				},function(e){
						$("#total").text('Total: '+e);
				});
			}
		}
	});
}	
$(document).on('ready',inicio);





</script>


</head>
<body>

<table border="10">
                      
		   
                     <div class="productouni">
                       
                    		<tr>
                            	<td><img src="./productos/1.jpg
" width="100" height="100"></td>
                                <td><span >Skate Mod 162 C/ Lija</span><br></td>
                                <td><span>Precio: 588.2</span><br></td>
                                <td><span>Cantidad: 
							<input type="text" value="4"
							data-precio="588.2"
							data-id="32"
							class="cantidad">
						</span><br></td>
                                <td><span class="subtotal">Subtotal:2352.8</span><br></td>
                                <td><a href="#" class="eliminar" data-id="32">Eliminar</a></td>
                         
                            </tr>
            
				</div>
    
    
    
 
    
				
			    
    
    
   
    
    
   
                    
                      
		   
                     <div class="productouni">
                       
                    		<tr>
                            	<td><img src="./productos/907837_1465413_454703301302688_1154107214_n.jpg" width="100" height="100"></td>
                                <td><span >zapatos</span><br></td>
                                <td><span>Precio: 120</span><br></td>
                                <td><span>Cantidad: 
							<input type="text" value="10"
							data-precio="120"
							data-id="46"
							class="cantidad">
						</span><br></td>
                                <td><span class="subtotal">Subtotal:1200</span><br></td>
                                <td><a href="#" class="eliminar" data-id="46">Eliminar</a></td>
                         
                            </tr>
            
				</div>
    



</table>


</body>

</html>

Espero que me puedan Ayudar Saludos...