If you do a VIEW SOURCE in the demo you''ll find the drop handler:
Droppables.add(''cart'', {accept:''products'',
onDrop:function(element)
{new Ajax.Updater(''items'', ''/shop/add'',
{onLoading:function(request)
{Element.show(''indicator'')}, onComplete:function(request)
{Element.hide(''indicator'')},
parameters:''id='' +
encodeURIComponent(element.id), evalScripts:true,
asynchronous:true})}, hoverclass:''cart-active''})
Just insert your own javascript in the OnDrop: to keep track of what
people have dropped in the basket, then pass the data off to your PHP
process when they''re done.
On Mar 19, 12:41 pm, "Mojojo"
<r...-DpxkScVyy3oAvxtiuMwx3w@public.gmane.org>
wrote:> Hello.
>
> I am trying to make an drag and drop shop just
ashttp://demo.script.aculo.us/shop
>
> But I want to do it without using ruby on rails, just plain PHP and
> script.aculo.us
>
> I have gotten so far that I can drag the items around on the screen
> but cannot figure out how it is dropped and into the basket
>
> Anyone got a simple example?
>
> Best regards
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---