Thank you for this awesome plugin! I have a question, and can't find the answer in the docs.
Can I use this plugin with multiple groups, selecting them by class? They are dynamically added, so I can't have pre-set IDs.
<ul class="group">
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
<ul class="group">
<li>D</li>
<li>E</li>
<li>F</li>
</ul>
In the code above, I'd like to be able to sort any LI within any UL with a class of .group.
You have to init Sortable for each and every of your lists. Grab your lists by class name and start sortable in for loop for every element. It's that simple. ex. using jQuery
var el = $('.group');
$(el).each(function (i,e) {
var sortable = Sortable.create(e, {
animation: 150,
handle: '.drag-handle'
});
})
Has anyone been able to implement this in the source (Dragula.js) file? I noticed the dragula plugin has it implemented. You can add an array as the first param.
Most helpful comment
You have to init Sortable for each and every of your lists. Grab your lists by class name and start sortable in
forloop for every element. It's that simple. ex. using jQuery