This project is read-only.

Drag onto another item in list

Dec 29, 2011 at 9:09 PM

Hello, I use this list alot, but I'm missing an option to drop an item onto another in the list. Just like creating folders on ipad and iphone. I'm trying to have three options with the objects in the list.

1 - Click the object as a regular link. Easy, just add "if (!e.altKey) return false;" or something in the grabItem function.

2 - Regular sorting, just as it is

3 - Drop onto each other which is the hard part. 


Can anybody help me?




Jan 14, 2012 at 12:56 AM
Edited Jan 18, 2012 at 11:51 AM

For option 1 there's a new release that allows hyperlinks to both be clicked on and dragged without the need for holding down the alt key here:

I don't have an ipad or iphone so not sure how you're thinking it option 2 and 3 would work together. Currently in the swapItems function when you drag an item over another item it swaps them, with the placeHolderTemplate used as the visual clue where the draggedItem will remain when you release the mouse. So would you change it so that there's a gap between the items and an arrow appears when you drag the item to that gap to indicate where it will remain when you release the mouse and if it is over another item for the dragged item to change appearance to indicate you are dropping it inside? Or is it like folders and files so you would differentiate both types with a css class so that when a folder or file is placed over a folder it changes appearance to indicate you're dropping it inside but if it's over a file it swaps them like how dragsort currently works?