1

I'm trying to use jQuery UI Sortable component to arrange rows within a table. (Code and markup posted at http://jsfiddle.net/LpyXh/.)

But I want to be able to drag groups of rows. In my example, whenever I drag a row, I also want to drag all the rows that have the current row as the parent (data-parent attribute). The result is that children will always be with their parent. Note that the rows I want to drag will always be grouped together.

But it's not looking like Sortable supports this. Any suggestions?

1 Answer 1

1

What about breaking up your parent/child groups into their own tables. Then you can just drag the tables. Wouldn't that be cleaner?

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

3 Comments

Yes, I'm sure it would. But this is a huge application and I'm really tasks to work with the markup that is already in place. The other option is to just drag one item, and then write code to move the child items when it's dropped. But it would be much nicer if I could make this part of the drag operation.
Just found this... not sure if it will work exactly as you want (as you have to click on each item), but it might get you part of theway there... stackoverflow.com/questions/3774755/…
Interesting. However, it seems a bit buggy. For one thing, the feature where the sortable components shifts things around while you drag doesn't work when I select multiple items. Also, if I drag 1 and 2 down to the bottom, there's no way to move them back where they started. I'll continue testing...

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.