| Page 1 of 1 | [ 5 posts ] |
|
I am a super YUI3 novice and I have gotten a drag-n-drop sortable list to work. That was the easy part. Now I would like to catch when something has been dragged. Is this possible?
I tried to use these events for nodesChange and containerChange but I clearly have no idea the correct way since this does not work. Code: YUI().use('sortable', function(Y) { var sortable1 = new Y.Sortable({ container: '#demo1', nodes: 'li', on: { nodesChange: function() { alert('nodes'); } }, after: { containerChange: function() { alert('container'); } }, after: { moveTypeChange: function() { alert('moveType'); } } }); } |
|
The above event stuff just doesn't work at all. The documentation says the copy event is for when a node is moved:
copy copy ( event ) A Sortable node was moved. I tried this code and the click event works, the copy does not. Code: YUI().use('event', 'node', function (Y) { var clickedNode = Y.one('#save-order-quicklink'); var draggedNodes = Y.all('.results-row'); if (draggedNodes) { draggedNodes.each( function(node) { node.on('click', function(eventFacade) { alert('click'); }); node.after('copy', function(eventFacade) { alert('copy'); }); }); } }); |
|
|
|
Well that works amazing and thanks for the link to the jsfiddle site! I was able to get rid of all my garbage code and use that moved event. Where did you find the list of what events you can call like 'moved'?
|
|
Since I wrote it, I kind of knew it
However, they are listed here: http://yuilibrary.com/yui/docs/api/clas ... table.html (I did see a bug in the doc parsing for it & I checked in a fix for the next release) |
| Page 1 of 1 | [ 5 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