Remove Drag & Drop Item from List

In the demo page, jQuery Demo Build, I want to have the ability to remove an item from the populated list.  
LVL 18
mgfranzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sudaraka WijesingheWeb Application ProgrammerCommented:
You have to make both your containers "droppable" and add the code to handle drops.
See the example in jQuery UI demo here http://jqueryui.com/demos/droppable/#photo-manager
0
mgfranzAuthor Commented:
Yeah, I saw that and it's almost exactly what I want, but I need to have capability to add duplicate items.  For instance, in my example page you can add one, two three or as many oranges you want as a built list.  But still have the ability to remove an item.
0
Sudaraka WijesingheWeb Application ProgrammerCommented:
To be able to drop multiple of the same object, you have to drop a clone of the object to the second box, so that the original is not removed from the first box.
http://stackoverflow.com/questions/6400154/jquery-ui-drag-and-drop-using-a-draggable-more-than-once
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

mgfranzAuthor Commented:
I'm already dropping duplicate items, I just need to be able to remove a particular item, do you have time to work on the code example?  I need to be able to use pictures to build a list.

My basic requirements;

1) Drag an image to an "overflow:auto" div  [done]
2) Allow the images to be moved around  [done]
3) Allow the removing of a particular image
4) Save the built image in the exact order placed for later processing  [in work]
0
Sudaraka WijesingheWeb Application ProgrammerCommented:
Try the attached demo, I modified it using your demo page.
demo.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mgfranzAuthor Commented:
You the man!  Quick and simple, I even learned something...  ;-)

      $('.shop-container').droppable({
                  accept: '#sortable li',
                  drop: function(event, ui) {
                        ui.draggable.remove();
                  }
            });
0
Sudaraka WijesingheWeb Application ProgrammerCommented:
Glad to help. Thanks for the points.
0
mgfranzAuthor Commented:
Before I submit another question, do you know the easiest way to process the built list for submit to a form page?  
0
Sudaraka WijesingheWeb Application ProgrammerCommented:
You can add a hidden INPUT element to each LI of the list, so when you submit you get the selected list.
0
mgfranzAuthor Commented:
Good idea!  
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.