You'll need a order field. And then the UISortable plugin does not give you the order of the dragged item, it only gives you a jquery object of the dragged item. What I do is to check the previous item in the list (In the update callback), and send the server the dragged items id, and the previous item on the lists id (If there is one), and work out server side what order the item must go into.
On Jun 23, 9:22 pm, "Dave Maharaj :: WidePixels.com" <[email protected]> wrote: > I am thinking of adding a drag/sort setup using jQuery UISortable feature. > > I want to add this to my images_controller / image model > > User hasMany entries > > Right now my images table is > id, > user_id > image > > What would i need to the table to get the save order? Simply add "order" > field and have jQuery send the values for each after sorting them? > > Thanks, > > Dave --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
