0

Ey dudes, please take a look at this fiddle: http://jsfiddle.net/HG8k6/.

$(document).ready(function () {
    $("ul.containers").sortable({
        axis: 'y',
        placeholder: "ui-state-highlight",
        forcePlaceholderSize: true
    });

    $("ul.containers").disableSelection();

    $("ul.rows").sortable({
        axis: 'y',
        placeholder: "ui-state-highlight",
        forcePlaceholderSize: true
    });

    $("ul.rows").disableSelection();
});

It's working ok in some way, I have containers and rows, I can move them perfect, but what I really want to achieve is to move rows between containers, for example move the Row5 from Container2 to Container1. Thanks in advance and greetings from Colombia, South America!!

1 Answer 1

3

Use connectWith:'.rows' updated fiddle

Sign up to request clarification or add additional context in comments.

4 Comments

Great! It works! So I've advanced in this... but please take a look at the fiddle, my problem now is when I add a dynamic container with a row, the row can not be dragged... weird... If I just add a row, it works like a charm. Thanks!
just initialize sortable on newly added rows. I have updated fiddle please look jsfiddle.net/HG8k6/4
Excellent! It's working great now, but why the container behavior is different from the row, both were added in a dynamic way. Thanks for your help!
Because jquery attaches sortable widget to parent and operates with it children, when u adding 'li.container' it is child of sortable 'ul.containers' and automatically li.container becaomes sortable but when you adding ul.rows to newly added li.container you have to attach sortable to newly added ul.rows so it children becomes sortable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.