我怎么拖到采用了棱角分明的UI一个空连接列表? [英] How do I drag to an empty connected list using angular-ui?
问题描述
作为后续<一个href=\"http://stackoverflow.com/questions/18975556/how-do-i-move-from-one-ui-sortable-to-another-in-angular/18975771\">How我从一个UI可排序移动到另一个在角?
如果我有2个连接列表,列表中的一个是空的,我怎么居然落到了吗?再次望着 http://minitrello.meteor.com 他有一个空列表甚至创造了一个占位符。我如何复制的,这样,当
If I have 2 connected lists, and one of the lists is empty, how do I actually drop onto it? Again looking at http://minitrello.meteor.com he has a placeholder created even in an empty list. How do I replicate that so that when
list1的= [];
列表2 = ['A','B','C']
其实我可以拖放到 list1的
?在 http://jsfiddle.net/hKYWr/894/
I can actually drop onto list1
? Fiddle at http://jsfiddle.net/hKYWr/894/
编辑:清洁小提琴在 http://jsfiddle.net/hKYWr/897/
推荐答案
如果您的列表是空的,然后还需要创建一个空的李
If your List is empty then also you need to create an empty Li
我已经在每个列表中添加了一个列表
I have added one List in each List
<li ng-show="list1.length==0"> </li>
<li ng-show="list2.length==0"> </li>
下面是工作演示
<大骨节病>
演示
骨节病>
模板code:
<div ng:controller="controller">
<div style="float:left; margin:5px;">
<h3>list1</h3>
<ul ui:sortable="sortableOptions" class="connectedList" ng:model="list1">
<li ng:repeat="item in list1" class="item">{{item}}</li>
<li ng-show="list1.length==0"> </li>
</ul>
</div>
<div style="float:left;margin:5px;">
<h3>list2<h3>
<ul ui:sortable="sortableOptions" class="connectedList" ng:model="list2">
<li ng:repeat="item in list2" class="item">{{item}}</li>
<li ng-show="list2.length==0"> </li>
</ul>
</div>
<div style="clear:both;"></div>
<hr />
<div>list1: {{list1 | json}}</div>
<div>list2: {{list2 | json}}</div>
</div>
这篇关于我怎么拖到采用了棱角分明的UI一个空连接列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!