johnny / jquery-sortable

A flexible, opinionated sorting plugin for jQuery
http://johnny.github.io/jquery-sortable/
Other
1.52k stars 441 forks source link

onDragStart won't get fired #215

Open LukasBombach opened 8 years ago

LukasBombach commented 8 years ago

Hi

i have a very simple example in which I want the user to choose items from one list and have him drop it in another. Items taken from the list to choose from should not get removed from that list. The code I wrote is fairly simple:

selectedArticlesList.sortable({
    group: 'front-page-articles'
});

articlesToChooseFrom.sortable({
    group: 'front-page-articles',
    drop: false,
    onDragStart: function ($item, container, _super) {
        console.log('drag start', $item);
        $item.clone().insertAfter($item);
        _super($item, container);
    }
});

However I onDragStart does not seem to get fired. the console.log is not getting executed.

JohnScottMcNerney commented 5 years ago

Make sure you are looking at the correct Sortable. I got this confused with the rubaxa Sortable.

LukasBombach commented 5 years ago

Wow, talk about reviving the dead :D