You could write a oncomplete callback that deletes the entry from the source list with a second ajax call to update the database. Not very elegant though. Perhaps its just simpler to wrap both lists in a div and update the whole thing with just one ajax call.
tarapage wrote: > Hi, > > I'm new to AJAX and to cake PHP, but am an experienced software > developer. I'm having trouble doing something that seems very > simple. I have two list boxes, both generated from a database. I > want to pick items from one list box and have them add to the other > list box. This is simple enough, I'm doing it with an link and using > ajax to update the destination list once it is added to the database. > I also need to remove that item from the source list when the person > hits add. I look at the documentation and it says that the update > uses one DOM id to update, and I need to update 2 DOM ids off of this > one action. Here is an example. > > Source List Destination List > [ADD] Entry 1 > [ADD] Entry 2 > [ADD] Entry 3 > > > When I click ADD On an entry, I want it to move to the destination > list and be removed from the source listing. So let's choose Entry 1. > > Source List Destination List > [Add] Entry 2 [Delete] Entry 1 > [Add] Entry 3 > > > I need this to happen with AJAX. I can get the Add to work to go to > the destination but I cannot do the Source change as well. Any > ideas? Do I have to add another ajax call besides the ajax->link? > > Also, when I delete from Destination List I need it to go back to > Source list. So If I hit Delete on Entry 1 I need it to look like the > original listing above... > > Source List Destination List > [ADD] Entry 1 > [ADD] Entry 2 > [ADD] Entry 3 > > > > All my entries in the source list are being read from the database > tables (and I wouldn't want to actually delete them from the tables > when the person adds them to the Destination List. All of my > Destination List items are stored in a table and can be physically > deleted when I hit Delete button. > > Any ideas would be appreciated. > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
