Because I spend a lot of time trying to figure out your code, maybe I
just give you mine, you will faster understand how to do what I want.
Two sortable lists (#1 and #2). Both of them are driven by MySQL
database, but each are driven by different MySQL "tables". The
sortable #1 is where I want that "Auto-ID" (as I call it) function to
work. Right now here is my onDrop function (everything is stored in a
different .js file):

Droppables.add("#1",
  {
    onDrop: function(element)
    {
        process(element.id, "addItem");
    }
  });

The self function of "addItem" is (in a different .class file):

case 'addItem':
        $content = trim($this->mMysqli->real_escape_string($content));
        $result = $this->mMysqli->query('INSERT INTO tasks SELECT *
FROM channels WHERE id="' .
                                        $content . '"');
        $updatedList = $this->BuildPlaylist();
        return $updatedList;

After it clones a row from one table to another, the list updates. But
I want not only to clone an item, but also give it a corret Id, so
it's not somewhere inside of a sortable but exactly where you've
dropped it.


On May 25, 8:37 pm, Walter Lee Davis <wa...@wdstudio.com> wrote:
> The script contacts the database through the Ajax.Request system in  
> Prototype. I can't find the code I posted to you, but all that part  
> was in there, I think. It sends a POST to the server with the type of  
> item that was dropped, and the server replies by first making a new  
> item of that type and then returning the database ID generated in the  
> process.
>
> What I'd like you to do is post what you have tried on Pastie or jsbin  
> (if the latter, you can mock up the Ajax.Request part and see it  
> running, but changing the POST to GET and requesting another jsbin  
> page that just returns text).
>
> I need to see what you're trying before I can suggest another route  
> for you to take.
>
> Walter
>
> On May 25, 2009, at 12:04 PM, WLQ wrote:
>
>
>
> > Yeah, but what I don't understand is how your script connects with a
> > database, I mean what are the cart, timeline, cart-active... are? I've
> > noticed we have some trouble understanding one another, can we talk
> > somewhere like msn?- 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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to