我试图在我的表格中拖放行 - angularjs。我目前的代码是
<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>
</tbody>{{list}}
<hr>
</div>
<script src="http://code.angularjs.org/1.0.2/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui/0.4.0/angular-ui.min.js"></script>
我的控制器代码是
var myapp = angular.module('myapp', ['ui']);
myapp.controller('controller', function ($scope) {
$scope.list = ["one", "two", "thre", "four", "five", "six"];
});
angular.bootstrap(document, ['myapp']);
它在http://jsfiddle.net/xfmh6ywm/中运行良好,但在http://jsfiddle.net/9z4zn9uz/中没有使用相同的代码。即使在我的网站上也类似于后者,我无法重新排列行。
答案 0 :(得分:-2)