views:

9

answers:

0

Hi peeps,

have a problem with the sortable plugin.

I have a dataset presented in tree form and using sortable to allow the user to drag elements from any branch to another.

The problem I now face is the dataset has become large so that connectWith option entails many lists connecting to many other lists.

Here is the offending code:

var $tree = $('#tree ul li:not(.closed) ul');

$tree
    .sortable({
        items: 'li',
        connectWith:    '#tree ul li:not(.closed) ul' ,
        cursor:         'crosshair' ,
        handle:         '.handle' ,
        helper:         'original' ,
        forceHelperSize: true ,
        forcePlaceholderSize: true ,
        tolerance:      'intersect' ,
        zIndex:         999 ,
        placeholder:    'sort-highlight' ,
        opacity:        '0.6' ,
        revert:     true ,
        start:          function(event,ui)
                        {
                            updateSent = false;
                            $tree.find('li:not(:has(ul))').append('<ul><li class="dummy"></li></ul>');
                            $('#tree li li').addClass('lipos');
                            $tree.sortable('refresh');
                        } ,
        stop:           function(event,ui)
                        {
                            $tree.sortable('destroy');
                            $tree.sortable('refresh');
                        }
    });

I would be cock-a-hoop if anyone could suggest an alternative that would still allow these nodes to be connected so that items can be dragged from within the sortable list and all other connected sortable lists without killing the browser.

MANY MILLIONS OF THANKS IN ADVANCE!!! (sorry for shouting)