sortable: stop option only if item on same list

sortable: stop option only if item on same list

Hi,

Is there a way to prevent the stop option doing something if the item was dropped to another list?

Because I want to do something only if the item is from the same list otherwise I use the receive option for items dropped to another list.

I've tried to somehow count the ui.sender like this:
  1. stop: function(event,ui) {
        if ($(ui.sender).length < 1) {
            if (ui.sender == null) {
                alert('items moved in the same list');
            }
        } else if (ui.sender != null) {
            alert('items moved to another list');
        }
    }








But this won't work. Hope for some hints. Thanks in advance.