-
Notifications
You must be signed in to change notification settings - Fork 438
items configuration parameter is broken #98
Comments
Here is a fork of your pen demonstrating the This seems to be a duplicate of #41, as the problem is caused by the div you are using for the titles of the lists.
Moreover, the elements (and their indexes) of the uiSostable should match the model provided. The simplest rephrase is that uiSortable should only contain a ngRepeat and not any other elements (above or below) as this would break the index matching od the DOM elements generated and the ngModel's items. Perhaps this should (at last) be mentioned in README.md, because of the frequency this is reported as an issue. Bonus Points:
|
Thanks for the quick and detailed response. This is exactly what the ui-sortable "items" parameter is intended for, to cherry-pick which items to activate the sortable on. Regarding your suggested solution, it does not achieve the intent of adding a title to the list, which references the model, and therefore needs to be inside the ngRepeat, If you have a suggestion to this need, would love to see it. |
Ok, let me show you a somewhat better solution. Also works with In other words... In the current state of the directive, only one ng-repeat element (and only this element) can be inside the ui-sortable directive. Patches welcome as mentioned in #41. |
Thanks. Your suggestion is indeed a decent workaround and solves my problem. |
Fixes angular-ui#41, Fixed angular-ui#177, Fixed angular-ui#98 and Fixes angular-ui#207
Fixes angular-ui#41, Fixed angular-ui#177, Fixed angular-ui#98 and Fixes angular-ui#207
Fixes angular-ui#41, Fixed angular-ui#177, Fixed angular-ui#98 and Fixes angular-ui#207
If you take the multiple lists example, and want to add a title to the lists, you'd normally exclude it from sorting using the items parameter: http://api.jqueryui.com/sortable/#option-items
However, this is not working.
If you do this: (I used both the css class and the ng-class, hoping at least one would work)
...
$scope.sortableOptions = {
placeholder: "app",
connectWith: ".apps-container",
items: "> .sortable"
};
See http://codepen.io/anon/pen/brgmk for an example which is based on the one provided here.
The title can be dragged (shouldn't), and if you drag around other items, after a while you end up with bogus items.
The text was updated successfully, but these errors were encountered: