Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

ui-sortable-stop not working every time in ui-sortable #556

Open
ghost opened this issue Sep 14, 2018 · 1 comment
Open

ui-sortable-stop not working every time in ui-sortable #556

ghost opened this issue Sep 14, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 14, 2018

here you can see i have gave 'uiSortable01Stop' as value to attribute ui-sortable-stop, so function uiSortable01Stop should be called everytime i reorder items under ng-repeat, but its not consistance, some time it misses the callback, and that's why my whole code gets screwed.

let me know if i am implementing it in wrong way. please suggest some solution for this. thanks in advance.

Below code is pasted :
<ul class="nav nav-pills shortable-tab nav-pills--success" id="m_sortable" role="tablist" ng-model="parentdata.samples" ng-if="data.is_default != '1'" ng-model="parentdata.samples" ui-sortable ui-sortable-start="uiSortable01Start" ui-sortable-stop="uiSortable01Stop" > <li class="nav-item mt-3" ng-repeat="sample in parentdata.samples track by $index"> <p class="text-center">sample {{($index + 1)}}</p> <a class="nav-link" data-toggle="tab" href="javascript:void(0)" ng-class="{'active' : (sample.activesample)}" ng-show="!sample.editing" ng-click="setActivesample($index)" ng-dblclick="startEditingsample($index)" > {{sample.metedata.sample_name}} </a> <input type="text" name="sample_name" id="sample_name" class="form-control m-input" ng-model="sample.metedata.new_name" ng-show="sample.editing" ng-enter="saveEditingsample($index)" ng-escape="discardEditingsample($index)" > </li> <li class="align-self-end"><a href="javascript:void(0)" ng-click="addNewsample()"><i class="fa fa-plus-circle"></i></a></li> </ul>

@thgreasi
Copy link
Contributor

Hi,
Could you try to remove the ng-if from your code and also try to use the ui-sortable="options" as the way to define the callbacks and see how it behaves?
If you still face an issue, then please fork one of the codepen examples found in README, so that we can troubleshoot this further.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant