Link to home
Start Free TrialLog in
Avatar of NiconPhantom
NiconPhantom

asked on

Jquery Droppable (Simple photo manager) - how to create an array of items in trash?

Hi,

here is an example of Jquery Droppable demo with the source code I am trying to implement:
http://jqueryui.com/demos/droppable/#photo-manager

I'd like to know how can I create an array of all items in trash?

Actually if somebody have an easy example of jquery Droppable with possibility to add images to div and then to create array it's also good solution for me )))

If any additional information will be required, please let me know and I'll immediately answer.
Avatar of NiconPhantom
NiconPhantom

ASKER

Somebody?
sounds like you are asking for what the demo does already... but when you say an 'array' do you mean a JavaScript array? are you looking for AJAX solutions?
Hi Blueghozt,

To be more specific, yes, the default functionality is ok for me, the only difference is that I'll replace the trash with the list of acceptable objects. All I need to do is to somehow create an array of all abjects inserted to "trash". Definitely I'll post an array with ajax function to my php controller on submit, but I am able to create the function like that. The only problem which I can't resolve - array creation which should contain all elements in trash. My idea is to add id attribute to <li> in style <li id="id of image"> and it's already implemented with php. No mather will I use src attribute of <img> tag or an id attr of <li> tag, the key poin is to have an array :-)
P.S. Yes, it should be JS array )))
I have found that I can use something like:


alert($('#trash li').get());


It returns an array of all <li> items located in trash, but how can I return array of id attributed only (<li class="test" id="234">Bla bla</li>)?
ASKER CERTIFIED SOLUTION
Avatar of NiconPhantom
NiconPhantom

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It takes time, but I did it ))))