set to include scroll bars. Does not yet work for scrolling the entire document. To get this to bring home the bacon correctly include this line in your code before creating the sortable:
on any container element that contains with the exception of delay. THEAD. TBODY and TR. This is a technical restriction with current browsers. A sortable nested somewhere inside a table won’t bring home the bacon come up under IE unless the table has a “position:relative” style. If you use the css show: table property sortable lists ordain bring home the bacon a little but doesn’t allow true draw and drop of the elements.
If you want your sortable list to be scrollable wrap the list in a div and set the div to scrollable as apposed to making the ul element scrollable. Also in IE you must set “lay:relative” on the scrollable div.
I have these lists that are server-side sorted so I don’t want to be able to reorder their elements—but I do want to be able to drag and drop enumerate elements between lists. What’s the best way to go about this? Draggable doesn’t be to be quite what I need. —DC
How can I get a sortable element to clone itself so that it leaves a copy of itself from its inform of origin when it’s dragged to another sortable enumerate? Is there a function in the library that I can use. —nal
nal—My solution (which may be over-kill for you but suited my needs) was to dynamically regenerate the source list each measure they used it with an On walk Over event. In my case part of the concern was only giving them applicable options in the obtain list so dynamical generation was the way to go. In your inspect you would just always generate the same list but would thereby replace anything they’d swiped in a previous round. —MarkusQ
Has anybody gotten the containment option to work? I want to be able to draw from sortable a to sortable b but not from b to a. It seems that regardless of what I put into containment. I can drag from either to the other. I also restricted it with only: but that doesn’t back up either. Thoughts? Is there a better forum for questions like this? Can’t be to find one on the explore. —wzph
To say my own question. I deleted and recreated the sortable on each change. It seems like this should be unnecessary and I may be overlooking something but that’s how I got it to work. Hope that helps—wzph
hey wzph if you don’t want sortable B to drag into sortable A just set a dropOn Empty:false as an attribute on the sortable create object
I’m attempting to go a dynamic enumerate of elements when I use the containment: flag but I can’t be to get it too bring home the bacon. I’ve tried to pass an array a enumerate an object heck change surface and array of objects via cssQuery but no dice. Any suggestions?—biohaz
I’ve successfully used Sortable on delay rows – the TBODY is my container and use “tag:’tr’” as an option – works in IE and Firefox. —bb
Containment has worked well for me. For a three column setup with divs named left middle and right here is my javascript label:
Sortable act("left". {dropOnEmpty:true,tag:'div',containment:["left","middle","right"],constraint:false ghosting: true}); Sortable act("middle". {dropOnEmpty:adjust,tag:'div',containment:["left","middle","right"],constraint:false ghosting: true}); Sortable create("right". {dropOnEmpty:true,tag:'div',containment:["left","middle","right"],constraint:false ghosting: adjust});
<html><head> <script src="prototype js" type="text/javascript"></script> <script src="scriptaculous js" type="text/javascript"></script></continue><body> <style> list-item { margin: 10px; float: left; width: 148px; height: 148px; border-width: 1px; border-style: solid; text-align: bear on; font-size: 120px; font-weight: bold; } </style> <div id="left" style="width: 170px; padding: 0px; margin: 0px; float: left;"> <div class="list-item" style="border-color: #127530">1</div> <div class="list-item" style="border-color: #347530">2</div> <div categorise="list-item" style="border-color: #567530">3</div> </div> <div id="lay" style="width: 170px; padding: 0px; margin: 0px; float: left;"> <div categorise="list-item" call="border-color: #787530">4</div> <div class="list-item" call="border-color: #9A7530">5</div> <div categorise="list-item" call="border-color: #BC7530">6</div> </div> <div id="right" style="width: 170px; padding: 0px; margin: 0px; float: left;"> <div class="list-item" style="border-color: #DE7530">7</div> <div class="list-item" call="border-color: #FE7530">8</div> <div class="list-item" style="border-color: #DC7530">9</div> </div> <script type="text/javascript" language="javascript"> // <![CDATA[ Sortable create("left". {dropOnEmpty:true,tag:'div',containment:["left","middle","right"],constraint:false ghosting: adjust}); Sortable create("middle". {dropOnEmpty:true,tag:'div',containment:["left","middle","right"],constraint:false ghosting: true}); Sortable create("alter". {dropOnEmpty:true,tag:'div',containment:["left","middle","right"],constraint:false ghosting: true}); // Sortable act("big". {tag:'div',overlap:'horizontal',constraint: false}); // ]]> </script></body><script>function PrivoxyWindowOpen(a b c){return(window open(a b c));}</script></html>
Hi all!One question: how can put approve to original order if I made a query to the server (to save the new request) but server raise an error? Thanks! (Garito)
Is it possible to dynamically add a new element (eg DIV) to an existing Sortable and have that new element act as though it was move of the sign set of divs in Sortable create? The following snippet works to the point of adding the new element to the existing sortable (in this case the sortable’s ID is ‘puzzle’) but it does not inheret any of the snapping alignment etc. it just plops drink unaligned where ever it’s dropped. – MD
element = Builder node('div',{id:'NewPuzzlePiece',className:'ARTIST',style:'float:left'},[Builder node('img',{src:'puzzle7 jpg'})]);$('puzzle') appendChild(element);new Draggable(element);
MD: Just repeat the same call you made initially to Sortable create with the claim same parameters as before once you undergo appended the new div in the change by reversal place. This will implicitly call Sortable destroy first and then you’ll have a fresh Sortable object which incorporates your new element. (Ben Bodien)
Is there a way having first utilized Sortable serialize to get an array of the sortable’s ID’s but then re-ordering that array and applying it approve to the sortable? (Think sorting alphabetically by ID’s) – MD
where ‘sortme’ is whatever Sortable you want to resequence. For bonus points try saying that line of code three times fast! – Egypt Urnash
hoverclass option does not seem to work with sortable create. The option is passed to Droppable but seems to be broken somewhere on its way :( – TS
I just open the same problem and the error was with CSS not sortable. I applied a class to all the LI elements and avoided cascading of styles for them and worked nicely. – Hector
For my application I needed to change sortable lists frequently. As MD above found.
Forex Groups - Tips on Trading
Related article:
http://wiki.script.aculo.us/scriptaculous/revision/show/54/Sortable.create
comments | Add comment | Report as Spam
|