angularjs dragdrop : I applied the ordering, but didn't changed the data

时间:2015-04-29 00:18:26

标签: angularjs angularjs-directive angular-dragdrop

It was hard to make this sample for sharing my situation.

Question 1. If you try this sample, I applied the orderBy attribute in ng-repeat and I added the attribute, applyFilter in jqyoui-drragble. The ordered list in the view is well-done. But If you drag one of these to the upper div scope, the item moved is not the order one, but the one in the status when it is not ordered.

upper div

<div class="caption">
                <div class="btn btn-info btn-draggable"
                    ng-repeat="item in userPerSystem | orderBy : 'userId' " ng-show="true" data-drag="true"
                    data-jqyoui-options="{revert: 'invalid'}" ng-model="userPerSystem"
                    jqyoui-draggable="{index: {{$index}},animate:true, applyFilter: 'filterIt'}">{{item.userId}}</div>
            </div>

below div

<div class="btn btn-droppable" 
                        ng-repeat="item in users | orderBy : 'userId'"  
                        data-drop="true" ng-model='users'
                        data-jqyoui-options="{accept:'.btn-draggable:not([ng-model=users])'}"
                        jqyoui-droppable="{index: {{$index}}, applyFilter: 'filterIt'}">

                        <div class="btn btn-info btn-draggable" data-drag="true" 
                            data-jqyoui-options="{revert: 'invalid'}" ng-model="users"
                            jqyoui-draggable="{index: {{$index}},animate:true}"
                            ng-hide="!item.userId">{{item.userId}}
                        </div>

Question 2 If I drag the item, I want to remove the item in the previous scope. How can I achieve this?

Thanks for reading my question.

0 个答案:

没有答案