I am using the Sortable plugin from the jQuery UI. Have it working perfectly, but I want to NOT sort and NOT be able to drag other items above the first item. I'm using this item as a title/header for the group and always want it fixed in the first position.
Looking at the jQuery documentation, it looks like I should use the items selector, but this breaks the entire script.
Any ideas? See code and link to JSFiddle below.
HTML:
<div class="cart-group">
<div class="cart-item no-drag">
Title Div
</div>
</div>
<div class="cart-group">
<div class='cart-item'>
Cart Item
</div>
<div class='cart-item'>
Cart Item
</div>
<div class='cart-item'>
Cart Item
</div>
</div>
JS:
$(".cart-group").sortable({
connectWith: '.cart-group',
opacity: 0.4,
tolerance: 'pointer',
cancel: '.no-drag',
items: 'div:not(.no-drag),
}).disableSelection();
Link to JSFiddle: http://jsfiddle.net/fZCfh/
Using jQuery 1.7.2 and jQuery UI 1.8.18.