3

I would like to implement the following:

Connected Nested Lists in Jquery UI Sortable

using Angular and the Angular Jquery UI Sortable. I need parents and children containers that are both sortable. Parents that you can rearrange the order (within the set of parents) and children that you can rearrange and also drag to a different parent.

Is it possible with the Jquery UI Sortable Angular directive or do I have to create a new directive for having nested lists?

Here is a jsFiddle that was created to solve the previous question: http://jsfiddle.net/HG8k6/4/

$("ul.containers").sortable({
    placeholder: "ui-state-highlight-container",
    revert: true,
    forcePlaceholderSize: true,
    axis: 'y',
    start: function (e, ui) {
        //alert("started");
    },
    update: function (e, ui) {
        //alert("updated");
        //save();
    }
});

function SetSortableRows(rows)
{
    rows.sortable({
    placeholder: "ui-state-highlight-row",
    connectWith: "ul.rows:not(.containers)",
    containment: "ul.containers",
    helper: "clone",
    revert: true,
    forcePlaceholderSize: true,
    axis: 'y',
    start: function (e, ui) {
        //alert("started");
    },
    update: function (e, ui) {
        //alert("updated");
        //save();
    }
});

}

2 Answers 2

1

Take a look at angular-ui-tree: https://github.com/JimLiu/angular-ui-tree. It does exactly this.

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

Comments

0

I think you can do two ui sortable, and connected them together.

Comments

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.