| Page 1 of 1 | [ 2 posts ] |
|
I look into Sortable utility (http://yuilibrary.com/yui/docs/sortable/) and Drag and Drop example called "List Reorder w/Bubbling" (http://yuilibrary.com/yui/docs/dd/list-drag.html).
"List Reorder w/Bubbling" is an example with a lot of manual code to handle drag-and-drop events. Sortable is a final library solution to make the same think in several lines of code. What I actually need in my projects is Sortable multiple lists with full join: http://yuilibrary.com/yui/docs/sortable ... -full.html Problem: I found that using sortable utility I cant drop item on empty container space. For example in list 1 you have a few records but the "content box" of list 1 is bigger. Draggin item from list 2 I cant drop it into empty space in list 1. I can drop only on another li element in list 1. Example: http://jsfiddle.net/TR5Xv/ This cause bad user experience. On other hand the example "List Reorder w/Bubbling" woks perfect with drop on empty space (example: http://yuilibrary.com/yui/docs/dd/list-drag.html) Question: Is it a bug in Sortable utility or there is a way to enable empty space as place where I can drop an element? Actually, I found a workaroud: I changed function _onDropOver in srotable.js source. Original code: Code: _onDropOver: function(e) { if (!e.drop.get(NODE).test(this.get(NODES))) { var nodes = e.drop.get(NODE).all(this.get(NODES)); if (nodes.size() === 0) { e.drop.get(NODE).append(e.drag.get(NODE)); } } } My changes: Code: _onDropOver: function(e) { if (!e.drop.get(NODE).test(this.get(NODES))) { e.drop.get(NODE).append(e.drag.get(NODE)); } } But I am not sure that this is correct path because I do not understand yet the whole drag-and-drop internal mechanisms. |
|
|
| Page 1 of 1 | [ 2 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