Hi,
I am trying the following with AJAX,
I have a list of entries from the Database, which you can take and
move into different boxes.
I suppose I need the drag and drop function from AJAX. ich have been
going through the world wide web to find some solutions but struggle
badly.
I also thought that I need dropRemote. So I found some stuff on the
net and tried to change this.
<?php echo $ajax->drag("cakepowerpng", $dragoptions1); ?>
<?php echo $ajax->drag("item_with_title", $dragoptions2); ?>
<div id="box1">
<div id="drag_area1"><div id="drag_space1" style="height:150px;">1</
div></div>
</div>
<div id="box2">
<div id="drag_area2"><div id="drag_space1" style="height:150px;">2</
div></div>
</div>
<div id="loading_div" style="display:none;padding:6px;">
<?php echo $html->image("ajax-loader.gif"); ?>
</div>
<?php
$drop_options1 = array(
"url" => "/dragdrop/dropped/",
"with" => "'id='+encodeURIComponent(element.id)",
"loading" => "Element.show('loading_div')",
"complete"=> "Element.hide('loading_div')",
"update" => "'+dropped.id+'", // I suppose here I have to
update the box where the element was dropped on
);
echo $ajax->dropRemote('drag_space2', //ID
array
("accept"=>"drop_ok_class","hoverclass"=>"dropspace_hover"),
$drop_options1); //AJAX option
echo $ajax->dropRemote('drag_space1', //ID
array
("accept"=>"drop_ok_class","hoverclass"=>"dropspace_hover"),
$drop_options1); //AJAX option
Of course the above does not work at all. But How would I get it
working? I need to see all the Elements in Box1 and Box2 and of course
this should be going to the controller aswell to update the Database.
Does anyone got an Idea how I would solve this? I am running out of
ideas. Thanks a lot.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---