【发布时间】:2016-09-04 13:42:47
【问题描述】:
我的 Angular 项目中有可排序的表行,但排序行还包含查询 UI 代码元素,现在我不想让最后一行不可排序。
HTML
<div ng:controller="controller">
<table style="width:auto;" class="table table-bordered">
<thead>
<tr>
<th>Index</th>
<th>Count</th>
</tr>
</thead>
<tbody ui:sortable ng:model="list">
<tr ng:repeat="item in list" class="item" style="cursor: move;">
<td>{{$index}}</td>
<td>{{item}}</td>
</tr>
<tr>
<td>Non Sortable</td>
<td>Non Sortable</td>
</tr>
</tbody>{{list}}
<hr>
</div>
控制器
var myapp = angular.module('myapp', ['ui']);
myapp.controller('controller', function ($scope) {
$scope.list = ["one", "two", "thre", "four", "five", "six"];
});
angular.bootstrap(document, ['myapp']);
JsFiddle 在这里工作:http://jsfiddle.net/valor_/fc7oftkn/
那么如何使最后一行不可排序?如果您需要任何其他信息,请告诉我,我会提供。提前谢谢你
【问题讨论】:
标签: javascript jquery angularjs jquery-ui