Ver Mensaje Individual
  #6 (permalink)  
Antiguo 07/08/2012, 01:02
vicluber
 
Fecha de Ingreso: agosto-2009
Mensajes: 51
Antigüedad: 14 años, 8 meses
Puntos: 1
Respuesta: Estoy es un array de javascript?

Bueno, ahora tiene mas color...

No conozco mucho jquery... nunca había usado ".live" así que lo cambie por un ".submit" y ahora si recibe el string para explotarlo.

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>TableDnD Server Example</title>
	<meta name="generator" content="TextMate http://macromates.com/">
	<meta name="author" content="DenisH">
    <link rel="stylesheet" href="tablednd.css" type="text/css"/>
	<script src="js/jquery.js" type="text/javascript"></script>
	<script src="js/jquery.tablednd.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
	// Initialise the table
	$("#table-1").tableDnD();
	// Make a nice striped effect on the table
	$("#table-1 tr:even").addClass("alt");
	
	$("#formid").submit( function (){
		var serializacion = $('#table-1').tableDnDSerialize();
		$('#guardarSerialize').val(serializacion);
	});
})		
</script>
</head>
<body>

<table id="table-1" cellspacing="0" cellpadding="2">
    <tr id="1"><td>1</td><td>One</td><td>some text</td></tr>
    <tr id="2"><td>2</td><td>Two</td><td>some text</td></tr>
    <tr id="3"><td>3</td><td>Three</td><td>some text</td></tr>
    <tr id="4"><td>4</td><td>Four</td><td>some text</td></tr>
    <tr id="5"><td>5</td><td>Five</td><td>some text</td></tr>
    <tr id="6"><td>6</td><td>Six</td><td>some text</td></tr>
</table>
<button onclick="alert('Serialized table is: '+$('#table-1').tableDnDSerialize())">Serialize</button>
<form id="formid" action="serverTest.php" method="get" accept-charset="utf-8">

	<input type="hidden" id="guardarSerialize" name="Serialize" value="">
	// TODO serialise doesn't work very well with a form does it!!!

	<p><input type="submit" value="Continue &rarr;"></p>
</form>
</body>
</html>
Dejo todo el código para que sirva de algo.

Leí en la doc de jqueri sobre el ".live" pero no me quedo muy claro. Porque no funciona con live y si con submit?