[英]Drag and drop of rows in table in jsfiddle not working - angularjs
I tried to have a drag and drop rows in my table - angularjs. 我试图在我的表中拖放行-angularjs。 My current code is
我当前的代码是
<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>
My controller code is 我的控制器代码是
var myapp = angular.module('myapp', ['ui']);
myapp.controller('controller', function ($scope) {
$scope.list = ["one", "two", "thre", "four", "five", "six"];
});
angular.bootstrap(document, ['myapp']);
it is working well in http://jsfiddle.net/xfmh6ywm/ but not working with same code in http://jsfiddle.net/9z4zn9uz/ . 它是在运作良好http://jsfiddle.net/xfmh6ywm/但不是在相同的代码工作http://jsfiddle.net/9z4zn9uz/ 。 Similar to latter fiddle even in my website, I am unable to rearrange the rows.
即使在我的网站中,类似于后面的小提琴,我也无法重新排列行。
Change the jQuery version from the left top corner dropdown to : jQuery 1.8.3 this would start working. 将jQuery版本从左上角的下拉菜单更改为:jQuery 1.8.3,它将开始工作。
updated fiddle:
http://jsfiddle.net/9z4zn9uz/1/ http://jsfiddle.net/9z4zn9uz/1/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.