【发布时间】:2015-10-04 23:07:09
【问题描述】:
我正在使用带有 Row Reordering add-on 的 jQuery DataTables,由于某种原因,我收到以下错误消息:
未捕获的 TypeError: $(...).DataTable(...).rowReordering 不是函数
当这样做时:
$(document).ready(function() {
$('#demo').html('<table cellpadding="0" cellspacing="0" border="0" class="display cell-border" id="example" ></table>');
t = $('#example').DataTable({
"columns":
[
{width: "10%", "className": "ageClass", "title": "Priority", "data": "priority" },
{"className": "actionClass", "title": "Action", "data": "action" },
],
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bInfo": false,
"bAutoWidth": false,
"scrollY": "200px",
"scrollCollapse": true,
"paging": false
}).rowReordering();;
// This line is where the console says the error is
for (var i = 0; i < 10; i ++)
{
t.row.add(
{
priority: i,
action: i,
}).draw();
}
});
HTML:
<div id="demo"> </div>
我只是在做这里描述的事情: https://code.google.com/p/jquery-datatables-row-reordering/wiki/Index
【问题讨论】:
标签: javascript jquery html datatables row