javascript - 在 jsfiddle 中拖放表中的行不起作用 - angularjs

标签 javascript jquery html css angularjs

我试图在我的表格中拖放行 - 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>

我的 Controller 代码是

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/ 中的相同代码.即使在我的网站中,也与后者类似,我无法重新排列行。

最佳答案

将左上角下拉列表中的 jQuery 版本更改为:jQuery 1.8.3 这将开始工作。

updated fiddle: 

http://jsfiddle.net/9z4zn9uz/1/

关于javascript - 在 jsfiddle 中拖放表中的行不起作用 - angularjs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27979950/

相关文章:

javascript - HTML/Javascript : Display:none copy and paste issue

javascript - Node.js 中的 `stream.Transform.unshift()`

javascript - 全局对象是哪个类的对象?

javascript - 清除页面部分

javascript - 在 IE 8+ 中运行时检测 IE 7 Emulate

javascript - 导入 Bootstrap 样式表时图像消失

javascript - 如何重置 jquery (select2) 中的下拉框?

html - 视频标签填充 100% div,无论比例如何

php - Cakephp 文本区域

html - 按钮 href 忽略问号后的所有内容