TypeError: oColumn is undefined When Using jQuery Datatables Library(类型错误:使用 jQuery 数据表库时未定义 oColumn)
问题描述
我在让 jQuery Datatables 库正确显示在我的 Joomla 网站表格上时遇到问题.http://datatables.net
I am having a problem getting the jQuery Datatables library to show up properly on my Joomla website table. http://datatables.net
脚本对我的表格进行了一半的样式设置,然后放弃了(我更改了表格标题颜色和文本颜色,但没有数据表控件等).
The script is half styling my table and then giving up (I am getting the table header colour changed and text colour, but no datatables controls etc).
Firebug 也抛出以下错误:
Firebug is also throwing the following error:
TypeError: oColumn is undefined
在我的 Joomla 模板 index.php 中,我在 中有以下内容:
In my Joomla templates index.php I have the following in the <head>
:
<script src="Li9kYXRhdGFibGVzL2pzL2pxdWVyeS5qcw==" type="text/javascript"></script>
<script src="Li9kYXRhdGFibGVzL2pzL2pxdWVyeS5kYXRhVGFibGVzLmpz" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('#staff_table').dataTable({
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": true,
"bAutoWidth": true
} );
} );
</script>
HTML/PHP 看起来像这样:
The HTML / PHP looks like this:
<h3>Members of Staff</h3>
<p>If you're looking for a member of staff at Tower Road Academy, you'll find their details here.</p>
<table class="staff_table" id="staff_table">
<tr class="staff_table_head">
<th>Name</th>
<th>Job Title</th>
<th>Email Address</th>
</tr>
<?php
$result = mysql_query("SELECT * FROM itsnb_chronoforms_data_addstaffmember");
while($row = mysql_fetch_array($result))
{
echo '<tr>';
echo '<td>' . $row['staff_name'] . '</td><td>' . $row['staff_job'] . '</td><td><a href=mailto:"' . $row['staff_email'] . '">' . $row['staff_email'] . '</a>' . '</td>';
echo '</tr>';
}
?>
</table>
推荐答案
为了使数据表正常工作,您的表必须使用正确的 For datatable to work properly, your tables must be constructed with a proper HTML 中的所有 DataTables 都需要一个 All DataTables needs in your HTML is a 数据表文档 这篇关于类型错误:使用 jQuery 数据表库时未定义 oColumn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网! 和
构建. 标签.
<thead>
and <tbody>
tags.,它格式良好(即有效的 HTML),带有标题(由
定义)HTML 标记)和正文(
标记)
<TABLE>
which is well formed (i.e. valid HTML), with a header (defined by a <THEAD>
HTML tag) and a body (a <TBODY>
tag)
本文标题为:类型错误:使用 jQuery 数据表库时未定义 oColumn


- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- PHP foreach() 与数组中的数组? 2022-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01