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

Buenas tardes... sigo intentando hacer una tabla drag & drop que actualize mi tabla mysql

El plugin tablednd que estoy intentando aplicar parece simple.

Es algo asi:

Código:
<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");
})		
</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 action="serverTest.php" method="get" accept-charset="utf-8">
	<input type="hidden" name="....">
	// TODO serialise doesn't work very well with a form does it!!!

	<p><input type="submit" value="Continue &rarr;"></p>
</form>
</body>
</html>
Ese formulario manda por get al archivo serverTest.php la funcion serialize del plugin... que nos devuelve algo como esto:

"Serialized table is: table-1[]=3&table-1[]=1&table-1[]=4&table-1[]=2&table-1[]=5&table-1[]=6"

Que es eso? Esta bien si supongo que eso es un array javascript ?
Y si me tiran una punta para poder recibirlo en el archivo php seria genial.

Saludos!