Php 无法读取属性';nTable';空的
我最近首次尝试使用datatables 当我测试我的站点时,我的控制台中会出现一些错误。。。。有人知道怎么解决吗Php 无法读取属性';nTable';空的,php,jquery,datatables,jquery-datatables,Php,Jquery,Datatables,Jquery Datatables,我最近首次尝试使用datatables 当我测试我的站点时,我的控制台中会出现一些错误。。。。有人知道怎么解决吗 Uncaught TypeError: Cannot read property 'nTable' of null _fnCallbackFire @ jquery.dataTables.js:5242 _fnLog @ jquery.dataTables.js:5070 (anonymous function) @ jquery.dataTables.js:6111 m.exten
Uncaught TypeError: Cannot read property 'nTable' of null
_fnCallbackFire @ jquery.dataTables.js:5242
_fnLog @ jquery.dataTables.js:5070
(anonymous function) @ jquery.dataTables.js:6111
m.extend.each @ jquery.js:2
m.fn.m.each @ jquery.js:2
DataTable @ jquery.dataTables.js:6092
$.fn.DataTable @ jquery.dataTables.js:14775
(anonymous function) @ datatable.php:134
m.Callbacks.j @ jquery.js:2
m.Callbacks.k.fireWith @ jquery.js:2
m.extend.ready @ jquery.js:2
J @ jquery.js:2
脚本加载在标题部分。通过包含header.php,当我直接将标题放入页面时,它不会改变任何内容
已加载以下脚本:
<script type="text/javascript" charset="utf-8" src="/assets/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="/assets/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="/assets/js/dataTables.tableTools.js"></script>
<script type="text/javascript" charset="utf-8" src="/assets/js/dataTables.editor.js"></script>
版本:
- jqueryv1.11.3
- 数据表1.10.7
- TableTools 2.2.4
- dataTables.editor 1.4.2
您可以在这里找到我的代码:您在DataTables初始化代码中有一个输入错误,
columns
应该改为columns
$('#adminlist').DataTable( {
dom: "Tfrtip",
ajax: "assets/php/table.admins.php",
columns: [
{data: "id" },
{data: "name" },
{data: "joindate" },
{data: "section" },
{data: "tutor" },
{data: "lesson1" },
{data: "lesson2" },
{data: "lesson3" },
{data: "versus" },
{data: "insults" }
],
tableTools: {
sRowSelected: "os",
aButtons: [
{ sExtends: "editor_create", editor: editor },
{ sExtends: "editor_edit", editor: editor },
{ sExtends: "editor_remove", editor: editor }
]
}
});
还有你的标签
发布表格html!!从给定的链接中,我看到您正在尝试在初始化数据表之前初始化编辑器。交换它们并尝试!!没有与该文件相关的任何技术最有可能是您引用了错误的表ID,或者HTMLStill中存在重复的ID。同一问题。@Exylian,发现了另一个问题,请更正并重试。在我的情况下,我是将数据表初始化到tbody,而不是初始化到表本身。这可能不是您的情况,但如果是,可能会帮助您排除故障。