Sortable grid option does not seem to work for me
I created a sortable:
$(function() {
$("#sortable").sortable({grid:[0,41]}, {tolerance:'pointer'}, {containment: 'parent'});
$("#sortable").disableSelection();
});
From this element:
<ul id="sortable">
<li class="ui-state-default" ><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 1</li>
<li class="ui-state-default" ><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 2</li>
<li class="ui-state-default" ><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 3</li>
</ul>
Which uses the default css that jquery ui provides.
The sortable works fine by default, but the items aren't sorting when I add the grid option.
Only when I change the x value on the grid to be something larger than zero does the grid option work, but even then the list items don't sort when you move them around.
I played around with the sortable options a bit and came up with this:
$(function() {
$("#sortable").sortable({grid:[1,41]}, {tolerance:'pointer'}, {containment: 'parent'}, {axis: 'y'}) ;
$("#sortable").disableSelection();
});
This does what I want it to, but it doesn't seem right that I have to make the x value on the grid larger than 0 and then restrict the axis to y in order for it to behave the right way.