Strangly but when i did this:
http://www.ruby-forum.com/topic/158430'
Drop don't work. I placed the code in different js file.
Sortable.create("fList", {constraint:false});
new Draggable('fish',{revert:true,ghosting:true});
new Draggable('chicken',{revert:true,ghosting:true});
Droppables.add('fList',
{accept:'meat',onDrop:function(dragName,dropName)
{placeFood(dragName,dropName)}})
var added = 0;
function placeFood(dragName,dropName) {
added ++;
$("fList").insert(new Element("li", { id: $(dragName).id
+added }))
$($(dragName).id+added).innerHTML = $(dragName).innerHTML
Sortable.destroy("fList");
Sortable.create("fList", {constraint:false});
}
I think there might be a syntax error.
On May 2, 4:25 pm, WLQ <[email protected]> wrote:
> Yeah well, I'm working on it for a week now, still can't get what I
> want :)
>
> Cheers, Yan
>
> On May 2, 4:16 pm, Alexander Bock <[email protected]> wrote:
>
>
>
> > I'm afraid I don't have the time to do that. You can find everything
> > you need to know by looking at the links I provided and using your
> > favorite search engine.
> > And look on the bright side, you'll learn something new by doing it
> > yourself :-)
>
> > Alex
>
> > Am 02.05.2009 um 16:03 schrieb WLQ:
>
> > > I don't really understand the syntax. Can you help me with creating
> > > it?
>
> > > Thanks, Yan
>
> > > On May 2, 3:58 pm, Alexander Bock <[email protected]> wrote:
> > >> You can use the onUpdate callback function
> > >> (http://wiki.github.com/madrobby/scriptaculous/sortable-create
> > >> ) to serialize your data
> > >> (http://wiki.github.com/madrobby/scriptaculous/sortable-serialize
> > >> ) and send an Ajax call to your server.
>
> > >> Alex
>
> > >> Am 02.05.2009 um 15:32 schrieb WLQ:
>
> > >>> But how can I make so it ads information to a database on drop?
>
> > >>> On May 2, 1:55 pm, Alexander Bock <[email protected]> wrote:
> > >>>> Take a look at this:http://www.ruby-forum.com/topic/158430("Can you
> > >>>> make a Sortable also Droppable?")
>
> > >>>> Alex
>
> > >>>> Am 02.05.2009 um 12:44 schrieb WLQ:
>
> > >>>>> So here's what I need:
> > >>>>> I need a sortable list which is driven of MySQL database (with
> > >>>>> autoupdate when order of items changes). And then I need a second
> > >>>>> sortable list (or anything that can be dropped on the first list).
>
> > >>>>> So if you drag and drop an item from the second list to the first.
> > >>>>> This item gets added to the first list, which means inside of that
> > >>>>> MySQL database with correct ordering.
>
> > >>>>> Hope you'll help.
> > >>>>> Thanks, Yan
>
> > >> PGP.sig
> > >> < 1KViewDownload- Hide quoted text -
>
> > >> - Show quoted text -
>
> > PGP.sig
> > < 1KViewDownload- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---