I'm using jQueryUI Sortable and connectWith to allow the dragging and dropping of items between 3 unordered lists.
Each list item contains a string and a value, and has an ID assigned. When the drag-drop has been completed, I want to sum the values of each item in each list and display the total at the bottom of each list.
I could do this with an AJAX call but at the moment, I can't quite get the data I need in a format I want from the lists.
Ideally, I'd like to get an array containing the UL ID's, that in turn contain an associative array containing the ID of the list item as the key and the numerical value from within it. I'm hoping by assigning an ID to the div that contains the numerical value within each LI, I can somehow extract it.
Any advice or pointers greatly appreciated.
Thank you.
The Fiddle outputs to the console.