tags:

views:

13

answers:

1

Hi,

I have a draggable connected to a sortable:

$("#panelTarget").sortable({
    distance: '15'
});

var element = $('<li>Hello</li>');
element.appendTo('#panelSource');
element.draggable();
element.draggable("option", "connectToSortable", '#panelTarget');

at some point, I want to make it impossible for the user to drop items onto the sortable panel (panelTarget). I'm trying this:

$('#panelTarget').sortable( "disable" );

but I can still drop elements onto it, am I not interpreting the docs correctly?:

http://jqueryui.com/demos/sortable/#method-disable

how can I block the user from dropping stuff on the panel?

Thanks

+1  A: 

This event/action comes from the .draggable() side, so you need to disable it there, like this:

element.draggable("option", "connectToSortable", false);
Nick Craver
Ah ok makes sense now, thank you.