jQuery UI sortable('cancel') - this.helper is null

Posted by Kerry on Stack Overflow See other posts from Stack Overflow or by Kerry
Published on 2010-05-26T05:46:14Z Indexed on 2010/05/26 5:51 UTC
Read the original article Hit count: 788

I am trying to disable a sortable element from sorting when it has been double clicked. When I try to disable it, even without a condition, it gives me the error 'this.helper is null'.

$('.roundedBox:first', division).sortable({
    start: function( event, ui ) {
        if( true === true ) {
            $(this).sortable('cancel');
        }

        $(this).parent().data( 'sorting', true ); 
    },
    stop: function() { 
        $(this).parent().data( 'sorting', false ); 
    },
    items: '.department',
    update: function() {},
    placeholder: 'department-placeholder'
})

Any ideas on how I can do this? I don't need it to be this method. Literally anything thing that stops it will work.

The problem is, sorting starts on a single click, but I have another action bound to double click. If it's double clicked, I don't want it to drag.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui