Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Draggable clone #138

Closed
TheBoef opened this issue Mar 3, 2014 · 5 comments
Closed

Draggable clone #138

TheBoef opened this issue Mar 3, 2014 · 5 comments
Labels

Comments

@TheBoef
Copy link

TheBoef commented Mar 3, 2014

Im pretty new to Angular, and Im trying to recreate this demo: "http://jqueryui.com/draggable/#sortable" but with mutilple sorted lists.

I got the ui-sortable working on my local machine, but its not working on Plunker... :(
http://embed.plnkr.co/WP8UKJBRWKK3rGy6A4nJ/preview

I can get the buttom 4 lists sortable and draggable with them self, but I want to add a list on the top that can only drag items in de sortable lists. Also the items that are dragged are copied (Just like the example on jqueryui).

I tried using https://github.com/codef0rmer/angular-dragdrop but it didnt got it too work with this ui-sortable.

Anyone has an example or an draggable module that works with this ui-sortable? It needs too has clone function from draggable.

@thgreasi
Copy link
Contributor

thgreasi commented Mar 3, 2014

I didn't know about the draggable/#sortable combo but I think that an issue with a similar use case was submitted at some point.
The final solution looked like this pen. You essentially clone the elements of the first list by restoring its model to the initial state right after the drag stops.

@thgreasi
Copy link
Contributor

thgreasi commented Mar 3, 2014

In the example you provided, the issue was that jquery-ui was loaded before jquery (as shown here).

@TheBoef
Copy link
Author

TheBoef commented Mar 4, 2014

Thanks for the example! Working with your solution right now!

@thgreasi
Copy link
Contributor

thgreasi commented Mar 4, 2014

I will just repost here:

I just found an jquery-ui issue that has a drop-clone example. It seems that jquery-ui does not provide a simple way to do this. In my opinion restoring the ng-model looks less like the trickery magic the jquery-ui example shows.
Also created a new pen, removing update&stop() in favor or (properly) utilizing the connectWith option.

Should this issue be considered resolved?

@TheBoef
Copy link
Author

TheBoef commented Mar 5, 2014

Yes, thanks for the help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants