Archive for 'ordinamento'


Drag & Drop con PHP & jQuery

Posted on 27. Jul, 2009 by daniele.

0

Codice jQuery:

 
 
$(document).ready(function(){
  function slideout(){
 
setTimeout(function(){
 
$("#response").slideUp("slow", function () {
 
});
 
}, 2000);}
 
$("#response").hide();
 
 $(function() {
 
 $("#list ul").sortable({ opacity: 0.8, cursor: 'move', update: function() {
 
 var order = $(this).sortable("serialize") + '&update=update';
 
 $.post("updateList.php", order, function(theResponse){
 
 $("#response").html(theResponse);
 
 $("#response").slideDown('slow');
 
 slideout();
 
 });
 
 }
 
 });
 
 });
 
});

Codice HTML:

 
<div id="list">
<div id="response"> </div>
<ul>
< ?php
include("connect.php");
$query  = "SELECT id, text FROM dragdrop ORDER BY listorder ASC";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$id = stripslashes($row['id']);
$text = stripslashes($row['text']);
?>
<li id="arrayorder_<?php echo $id;?>">< ?php echo $id;?> < ?php echo $text;?>
<div></div>
</li>
 
< ?php } ?>
</ul>
</div>
 

Codice PHP:

 
< ?php
include("connect.php");
$array = $_POST['arrayorder'];
if ($_POST['update'] == "update"){
$count = 1;
foreach ($array as $idval) {
$query = "UPDATE dragdrop SET…

Continue Reading

TinyTable JavaScript Table Sorter – 2.5KB

Posted on 10. Apr, 2009 by Administrator.

0

TinyTable è una piccola libreria per ordinamento di tabelle.

Link http://www.leigeber.com/2009/03/table-sorter/

Continue Reading