duplicate rows using jQuery UI sortable

237 views
Skip to first unread message

Ben Sgroi

unread,
Aug 9, 2012, 11:34:31 AM8/9/12
to ang...@googlegroups.com
So here's the problem: I'm using Angular with the jQuery sortable() widget, which means that after the sorting is done, I have to manually adjust the model and call $scope.$apply(), so that Angular catches on.  The sortable items are grouped into separate tables however, so I have to adjust the groups afterwards as well.  The catch is that if someone drags all of the lines out of a group, that group should disappear.  What's happening instead is that the group disappears, but somehow the recently dragged item gets duplicated in its new destination.  Angular seems to know that the model is correct, but the UI isn't catching on correctly.   Note that if you remove the code that deletes empty groups, dragging all items out of a group works as expected.

You can see what I mean here.  If you drag the item from Group 1 into Group 0, that item gets duplicated in Group 0.   Not sure why this is happening, since Angular's model appears to be correct.

Anyone have any ideas?  Thanks.
Reply all
Reply to author
Forward
0 new messages