You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.
I seem to be stuck on a problem when dragging one item from one list to another list it generates a duplicate item on the list it got moved to.
Here's a pen: http://codepen.io/anon/pen/HrCoG
The set up for this pen is having one list of items with an id and with a column property.
I then have two ng-repeats that make use of that list of items but one is filtered by "column:'a'" and the other one is filtered by "column:'b'".
When dragging an item, on beforeStop updates the item's column property so that it gets listed on the correct list.
How you can mimic this:
Pick up "10 Gmail (b)"
Drop it anywhere on the left list
You should see:
* "10 Gmail (b)" has been added to the bottom of the left list
* "03 Gmail (a)" has been duplicated
I think it clones the item in the left list with the same index of the item that was moved in the right list.
This doesn't seem to happen when moving an item from the left list to the right list.
The text was updated successfully, but these errors were encountered:
In your pen I can see that both of your sortables are using the same full-14-items model but the repeaters inside them use just a filtered (down) version.
The items of ng-model must match the indexes of the genretated DOM elements. As a result, the model that you provide to ui-sortable should match the model you provide to ng-repeat. If you need to apply filtering and/or sorting, do it in the controller before you pass the final model to ui-sortable & ng-repeate. #70 has an example of how to use angularjs filters inside a controller and then pass the final model to the directives.
I suppose that one more revision of the README must be written, but its somehow stated that
...Otherwise the index matching of the generated DOM elements and the ng-model's items will break.
Seriously now, how people expect the original (non filtered/ordered) model to be updated, after sorting a modified sub-model of that??? I really can't find an example.
Lets say I have a list like 1,2,3,4,5,6 and I filter the even numbers (so the list is now 2,4,6) and then I move 6 above 2. In my opinion its obvious that angular+ui-sortable can't change the original list.
(If someone thinks that it should be able to do that, which element should be first 1 or 6???)
Hello,
I seem to be stuck on a problem when dragging one item from one list to another list it generates a duplicate item on the list it got moved to.
Here's a pen: http://codepen.io/anon/pen/HrCoG
The set up for this pen is having one list of items with an id and with a column property.
I then have two ng-repeats that make use of that list of items but one is filtered by "column:'a'" and the other one is filtered by "column:'b'".
When dragging an item, on beforeStop updates the item's column property so that it gets listed on the correct list.
How you can mimic this:
* "10 Gmail (b)" has been added to the bottom of the left list
* "03 Gmail (a)" has been duplicated
I think it clones the item in the left list with the same index of the item that was moved in the right list.
This doesn't seem to happen when moving an item from the left list to the right list.
The text was updated successfully, but these errors were encountered: