Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why does parent sortable drop and drag,child sortable can't drop and drag with angular #331

Closed
xjinza opened this issue Apr 8, 2015 · 9 comments

Comments

@xjinza
Copy link

xjinza commented Apr 8, 2015

qq 20150408151918
why does parent sortable can drop and drag,child sortable can't drop and drag with angular,when the scope data changed ,without ng-sortable.js . clike the change button, parent sortable can drop and drag,but child sortable can't drop and drag.
code like this :
http://jsbin.com/kalojosuka/1/edit?html,css,js,output

@RubaXa
Copy link
Collaborator

RubaXa commented Apr 10, 2015

Try dev-branch and use only ng-sortable.js
Example: http://jsbin.com/huyipuniwo/1/edit?html,output

@RubaXa RubaXa added the angular label Apr 10, 2015
@xjinza
Copy link
Author

xjinza commented Apr 13, 2015

thanks a lot

@tplaner
Copy link

tplaner commented Apr 14, 2015

This seems to still have a bug, if you have more than 2 child items they can't be reordered properly:

http://jsbin.com/qudizihodo/2/edit?html,output

All of the children objects always have an oldIndex of 0 when onUpdate is called.

From my initial investigation it looks like _index(el) is returning the parent's draggable index.

@RubaXa
Copy link
Collaborator

RubaXa commented Apr 14, 2015

http://jsbin.com/qudizihodo/2/edit?html,output — example does not work.

@tplaner
Copy link

tplaner commented Apr 14, 2015

Sorry about that, can you try this example:

http://jsbin.com/denozivupe/1/edit?html,output

Try to reorder Item 5 in group A and you should see the issue.

@vimportant
Copy link

in this case,_onTapStart() function was fired 2 times, firsrt time is child scope and second is parrent scope, so oldIndex was set parrent index. so, i added evt.stopPropagation(); at the end of this function, it works. hope fixed this issue for next version :)

tplaner added a commit to tplaner/Sortable that referenced this issue Aug 18, 2015
@piernik
Copy link

piernik commented Sep 3, 2015

I can confirm that @tplaner 's solution works great.
Please add it to official

@eltexsoft
Copy link

@tplaner Thanks Tom, you saved us time as well!

@RubaXa
Copy link
Collaborator

RubaXa commented Jul 5, 2016

Dear all! ng-sortable.js is moved to the separate repository. If this issue is still actual, please create it there once again and this rojects needs a maintainer:

@RubaXa RubaXa closed this as completed Jul 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants