-
Notifications
You must be signed in to change notification settings - Fork 438
ng-repeat-start and ng-repeat-end cause wonky behaviour in indexes #64
Comments
This is not currently in the use cases of the sortable directive. I suppose it would be nice to have as an enhancement. Angular 1.2 changed lots of things for this directive, that have to be fixed first. |
I believe this is the issue I am having. http://plnkr.co/edit/6XlQLBZwG7UrhINQYwAm?p=preview In the bottom table I can't actually change the order of the items only add empty rows. I can re-order in the top table. |
Thanks for providing an example but using ng-repeat-start and ng-repeat-end is not supported and this issue is marked as
|
It would be a very nice enhancement to have. I am assuming this will never happen though ;-( |
In order for this to work, we should:
In my mind this is a wontfix, since such an implementation would add a lot On Wed, Mar 18, 2015, 19:49 RC1245 [email protected] wrote:
|
For the record, I found the issue by trying to use the library on a dl / dt / dd structure:
I found out it didn't work because ui-sortable moved the dt (for example) and not the dd with it. |
A workaround, for anyone else having this issue, is to use multiple tbody's, combined with ng-repeat-start if you're already repeating tbody's. In the end the final solution to this for me was:
This should work (as far as I can see) in all scenarios that need repeats on tables. |
Hi @jgr3go |
@funzeye you might just need a |
Hello , i faced this problem also, hop it will works, cheers. |
Hi, i know it is very late reply. but it may help come people. |
Using ng-repeat start and ng-repeat-end to repeat say, two TR-elements inside a table, and then using sorting on that tbody-element, causes the index that ui-sortable uses to be doubled.
So inside the callbacks.stop() function, where ui.item.sortable.dropindex is checked, it reports a value that is double the real value. And for every TR element added, this value is multiplied.
I have something like this:
And, dragging and dropping those tbody-elements cause the sorting to fail, because the index is wrong.
The text was updated successfully, but these errors were encountered: