【发布时间】:2017-11-06 23:38:52
【问题描述】:
我使用的是 Datatable 插件版本 - 1.10.15
我想让我的表行可拖动以更改排序顺序,为此我使用数据表的“行重新排序”功能,但它不起作用
给我一个错误:Uncaught TypeError: table.rowReordering is not a function
This is my work 但不起作用
我正在尝试包含所有相关的外部资源
我的脚本是
$(document).ready(function() {
var table = $('#example').DataTable({
"iDisplayLength": 50,
'createdRow': function(row, data, dataIndex) {
$(row).attr('id', 'row-' + dataIndex);
}
});
table.rowReordering();
});
请通过查看我的示例帮助我找出我哪里出错了
【问题讨论】:
-
嘿 Nidhi,我想你可能也在寻找类似的东西?click here
-
$(document).ready(function() { var table = $('#example').DataTable({ iDisplayLength: 50, rowReorder: true, createdRow: function(row, data, dataIndex) { $(row).attr('id', 'row-' + dataIndex); } }); }); -
谢谢你的帮助,是的@JaykumarGondaliya 我从这里得到提示并按照步骤操作但给了我一个错误。你可以看到我的尝试。我在我的问题中提供小提琴链接
-
谢谢@AlivetoDie。我试过你的答案。它可以拖动行但不会卡在某个位置。见here
-
嘿@Nidhi 请检查here