我有以下的jQuery数据表不能重新初始化数据表,jQuery的数据表
<table class="table table-striped table-bordered table-hover" id="dataTables-table">
<thead>
<tr>
<th>
Date
</th>
<th>
Firstname
</th>
<th>
Lastname
</th>
</tr>
</thead>
</table>
和JS初始化代码
$(document).ready(function() {
$('#dataTables-table').dataTable({
"bDestroy": true,
"processing": true,
"serverSide": true,
"ajax": "/Home/ShowData"
});
});
在加载HTML页面我得到
数据表警告: table id = dataTables-table - 无法重新初始化DataTable。
你已经这样做了别的地方在网页上 - '$(“#数据表,表”)的dataTable({'在这种情况下,检查是否DT是已经初始化并采取相应的措施。 – lshettyl
您使用的是哪个版本的数据表? – trevor