在AngularJS中的元素jQuery.sortable上是否易于使用ng-repeat?
如果重新排序自动传播的项目,这将排序回源数组,这将是非常棒的.我担心这两个系统会打架.有一个更好的方法吗?
我想知道如何使用AngularJs拖放.
这是我到目前为止:
<span><input type="checkbox" ng-model="master"><span>SelectAll</span></span>
<div ng-repeat="todo in todos">
<div ng-hide="enableEditor">
<a href="#">Drag</a>
<input id="checkSlave" type="checkbox" ng-checked="master" ng-model="todo.done">
<span ng-if="checked" ng-show="removed" ng-bind="todo.task_name" class="removed"></span>
<span ng-bind="todo.task_name"></span>
<span ng-bind="todo.state"></span>
<a href="#" ng-click="editTask(todo.task_id,todo.task_name,editMode=!editMode)">Edit</a>
</div>
</div>
<div ng-show="enableEditor">
<input type="text" ng-show="editMode" ng-model="todo.task_name" ng-change="update(todo.task_id,todo.task_name)">
<a href="#" ng-click="saveTask(todo.task_id,todo.task_name,editMode=!editMode)">Save</a>
<a href="#" ng-click="cancelTask(todo.task_id,todo.task_name,editMode=!editMode)">Cancel</a>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我想要在表格中重新排列行的功能(使用拖放操作排序行). 行排列的索引也应该在模型中改变.
我怎样才能做类似的事情:http://jsfiddle.net/tzYbU/1162/ 使用Angular Directive?
我正在生成表格:
<table id="sort" class="table table-striped table-bordered">
<thead>
<tr>
<th class="header-color-green"></th>
<th ng-repeat="titles in Rules.Titles">{{titles.title}}</th>
</tr>
</thead>
<tbody ng-repeat="rule in Rules.data">
<tr>
<td class="center"><span>{{rule.ruleSeq}}</span></td>
<td ng-repeat="data in rule.ruleData">{{statusArr[data.value]}}</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)