The dev version , which will be released in December 2014, presents an option sort: <Boolean>. Setting it to falsedisable the ability to sort the list. This is useful if you want to have a "source" list from which you can drag and drop items to the "target" list, but don’t want to sort the items in the source list.
- http://rubaxa.imtqy.com/Sortable/#ag
: http://jsbin.com/sevofa/1/edit?html,js,output
var sortable = new Sortable(document.getElementsByClassName('sortable')[0], {
group: 'foo',
sort: false,
animation: 150
});
switcher.onchange = function () {
var on = switcher.sort.value == 1;
sortable.option('sort', on);
};
<script src="https://rawgit.com/RubaXa/Sortable/dev/Sortable.js"></script>
<form id="switcher">
sort:
<label><input checked name="sort" value="0" type="radio"/> false</label>
<label><input name="sort" value="1" type="radio"/> true</label>
</form>
<ul class="list-group sortable">
<li class="list-group-item">This is <a href="http://rubaxa.imtqy.com/Sortable/">Sortable</a></li>
<li class="list-group-item">It works with Bootstrap...</li>
<li class="list-group-item">...out of the box.</li>
<li class="list-group-item">It has support for touch devices.</li>
<li class="list-group-item">Just drag some elements around.</li>
</ul>
Hide result