Moving from jQuery UI 1.8.24 to 1.9.0 breaks sortable in my application. (If I change back to 1.8.24 it works again.) JQuery is at 1.8.2. Can't provide a sample.
I get an error "cannot call methods on sortable prior to initialization; attempted to call method 'enable'". I wonder if this has anything to do with this announcement from
http://jqueryui.com/changelog/1.8.6/ "Removed: Don't throw errors for invalid method calls (wait till 1.9 to add this back)."
Code goes like this:
- $(document).on('click', 'a.sortLevel.notClicked', function(event)
{
event.preventDefault();
$('.sortLevel').css('border', '2px solid green');
$('.sortLevel').removeClass('notClicked');
$('.sortLevel').addClass('clicked');
$('#boxSortable').sortable('enable');
$('#boxSortable').sortable({items: 'div.levelBox'});
$('#boxSortable').disableSelection();
$('#ajaxOutput').text( "Sorting" );
});
This is embedded in the page via <script> tag. I'm not using $(document).ready(function(). However, the page surely is fully loaded and other jQuery code ($.ajax) works just fine.
(Edit: wrapping it in document ready doesn't make a difference.)