| Page 1 of 1 | [ 3 posts ] |
|
I'm trying to do something and am sooo close.
I want to have a pallet of things and be able to drag from that pallete into a list. Now here's the tricky thing. When I drag out of the pallet use the option to clone the node, as I might want to drag the same control in the pallet into the list in multiple places. The list that I'm dragging into is sortable, so the user can re-arrange things. I've managed to create the 2 things seperately, dragging from the toolbox and the sorting in the list but what I would really like is when the item is dragged over it makes a space for it so you can insert it into the desired point in the list. The examples for dragging from one sortable list to another come very close, the problem is that the items dragged are not cloned, so they are removed from the original location. Has anyone seen an example of what I'm trying to do, or is there a sortable list option I haven't seen that says not only can you drag from list a to list b, but we'll clone the node too. |
|
You can set the "moveType" config option on the Sortable to "copy":
http://developer.yahoo.com/yui/3/api/Pl ... g_moveType The values are: insert, swap, move, copy. It defaults to: insert. |
|
It's close, real close.
The bahaviour is a bit odd though. When you drag something from the toolbox onto the main list if you decide not to and mouse away from it it still adds it, and opacity acts a little strange. Starting to think I'll have to stick with the regular drag and drop onto a sorted list but hook up some sort of event handling so that when the mouse is over a list element it detects its its in its upper or lower half and put in a ghost placement div between them. |
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group