Idées pour ergolant drag and drop à creuser
http://dieter.plaetinck.be/drag_n_drop_tutorial_with_cakephp_ajax_prototype_scriptaculous
http://www.endyourif.com/drag-and-drop-category-management-with-cakephp/
http://www.gregphoto.net/sortable/advanced/
http://scriptaculous.le-developpeur-web.com/scriptaculous.demo.php
scriptaculous et extraire
cake/app/views/layouts/layout.ctp
<head>
<title>blabla</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php
echo $javascript->link('prototype.js');
echo $javascript->link('scriptaculous.js?load=effects');
?>
cake/app/app_controller.php
ajouter entre les balises class:
// controller file
var $helpers = array('Html', 'Javascript', 'Ajax');
function view() {
$this->render('layout file', 'ajax');
}
ici j'ai pris cake/app/views/pages/home.ctp pour avoir ajax sur la homepage
<h2>Table remarques</h2>
<ul><li>
<?php
#radeff: here a small example of using ajax / scriptaculous
#see http://www.akademia.ch/dokuwiki/info:cake#scriptaculous
echo $html->link('Remarques','#',array('onclick'=>'Effect.toggle("remarques", "blind", {duration: 0.2}); return false;'));
$event=array("Remarques"=>"remarques",
"Insérer une nouvelle remarques"=>"remarques/add"
);
?>
<sup>*</sup></li></ul>
<dl id="remarques" style="display:none;">
<?php foreach ($event as $lib=>$url): ?>
<dt><a href="<?php echo $url?>"><?php echo $lib; ?></a></dt>
<?php endforeach; ?>
</dl>