- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
因此,我在使用 php 从数据库迭代的一大组行上收到控制台错误。我正在用 metronic 主题初始化它。正如你所看到的,我有我的头部和 body 。
我怀疑问题可能与输出的大小有关,并且可能需要使用其他方法,任何指导表示赞赏
<table id="sample_1" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th class="table-checkbox">
<input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
</th>
<th>Name</th>
<th>Source</th>
<th>Email</th>
<th>Customer</th>
<th>Created</th>
<th>Login</th>
<th>Active</th>
<th>Role</th>
<th>Incentive</th>
<th>View</th>
<th>Switch</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<?php
$users=user::get_all($filter);
if($users){
foreach($users as $row){
$customer=user::get_cutomer_name_by_source_id($row['source_id']);
?>
<tr class='odd gradeX'>
<td><input type='checkbox' class='checkboxes' value='1'/></td>
<td><?php echo $row['first_name']." ".$row['last_name']; ?></td>
<td><?php echo $row['source_id']; ?></td>
<td><?php echo $row['email']; ?></td>
<td><?php echo $customer; ?></td>
<td><?php echo date("m/d/Y", strtotime($row["created"])); ?></td>
<td><?php if($row['login']!=NULL){echo date("m/d/Y",$row['login']);} ?></td>
<td><?php if($row['active']==1){echo "Yes";}else{echo "No";} ?></td>
<td><?php echo user::get_role_name($row['rid']); ?></td>
<td><?php
if($row['cash_incentive']==1){echo "Cash";}else{echo "Regular";} ?>
</td>
<td><a href='user-edit?uid="<?php echo $row['uid']; ?>"'>View </a></td>
<td><a href='switch?email="<?php echo $row['email']; ?>"'> Switch</a></td>
<td><input type='checkbox' name='email-list[]' value='<?php echo $row['email']; ?>'></td>
</tr>
<?php }
}
?>
</tbody>
这是数据表的 metronic 初始化:
table.dataTable({
// Internationalisation. For more info refer to http://datatables.net/manual/i18n
"language": {
"aria": {
"sortAscending": ": activate to sort column ascending",
"sortDescending": ": activate to sort column descending"
},
"emptyTable": "No data available in table",
"info": "Showing1 _START_ to _END_ of _TOTAL_ entries1",
"infoEmpty": "No entries found",
"infoFiltered": "(filtered1 from _MAX_ total entries)",
"lengthMenu": "Show _MENU_ entries",
"search": "Search:",
"zeroRecords": "No matching records found"
},
// Or you can use remote translation file
//"language": {
// url: '//cdn.datatables.net/plug-ins/3cfcc339e89/i18n/Portuguese.json'
//},
// Uncomment below line("dom" parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout
// setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js).
// So when dropdowns used the scrollable div should be removed.
//"dom": "<'row'<'col-md-6 col-sm-12'l><'col-md-6 col-sm-12'f>r>t<'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12'p>>",
"bStateSave": true, // save datatable state(pagination, sort, etc) in cookie.
"columns": [{
"orderable": false
}, {
"orderable": true
}, {
"orderable": false
}, {
"orderable": false
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": true
}, {
"orderable": false
}],
"lengthMenu": [
[5, 15, 20, -1],
[5, 15, 20, "All"] // change per page values here
],
// set the initial value
"pageLength": 5,
"pagingType": "bootstrap_full_number",
"language": {
"search": "My search: ",
"lengthMenu": " _MENU_ records",
"paginate": {
"previous":"Prev",
"next": "Next",
"last": "Last",
"first": "First"
}
},
"columnDefs": [{ // set default column settings
'orderable': false,
'targets': [0]
}, {
"searchable": false,
"targets": [0]
}],
"order": [
[1, "asc"]
] // set first column as a default sort by asc
});
最佳答案
columns
指定的数组中的项目数选项应匹配 <td>
的编号元素。 columns
中有 12 个元素数组和 13 <td>
元素。
来自manual :
Note that if you use
columns
to define your columns, you must have an entry in the array for every single column that you have in your table (these can benull
if you don't which to specify any options).
将额外对象添加到 columns
数组以匹配 HTML 中的列数。
或者您可以替换 columns
与 columnDefs
完全是为了可读性。
"columnDefs": [{
"orderable": false,
"searchable": false,
"targets": [0]
}, {
"orderable": false,
"targets": [2, 3, 11, 12]
}
],
参见jQuery DataTables: Common JavaScript console errors有关此错误和其他常见控制台错误的更多信息。
关于jQuery Datatables 大数据集 Uncaught TypeError : Cannot read property 'mData' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33091881/
请指导我做错了什么! Javascript: $(function() { $('#example').dataTable({ "scrollY"
我只想使用多 4 行的 jquery 可编辑数据表,但我看到此错误:无法读取未定义的属性“mData”。 如果我输入 4 和 4 数据表效果很好,但如果我放 5 个或更多 和 我得到无法读取未定义的属
我正在尝试学习如何在 iOS 上操作音频,并且我在 Apple 的开发者页面上阅读了很多内容。但是,我已经达到了拥有 AudioBuffer 的地步,但我不确定如何处理它。我知道它包含一个 mData
当我使用 jQuery 数据表时出现以下错误。 错误:无法获取未定义或空引用的属性“mData” 代码 $(document).ready(function() {
我对 Datatables 有疑问。我也经历了this link没有产生任何结果。我已经包含了我将数据直接解析到 DOM 中的所有先决条件。 脚本 $(document).ready(function
我有以下包含 6 列的数据表。 渲染表格后,我正在初始化 .DataTable()。但是得到错误: 'mData' of undefined TypeError: Cannot read proper
在我的一个项目中,我正在使用数据表。这是我表中导致错误的一列结构: Day Run
下面是我的 api 响应, { "aaData":{"req":[{"requests":"132"}]}} 需要在下面的 jquery 数据表中显示请求值是我的代码, "aoColumnDefs":
我是 iOS 编程新手,我正在使用此处找到的一些代码:http://code.google.com/p/ios-coreaudio-example/ 基本上,我从麦克风获取输入并将其直接路由到扬声器/
我有一个带有渲染回调的 RemoteIO 音频单元。我已经有一个渲染音频缓冲区,出于性能原因,我想避免使用 memcpy。 OSStatus FMixerPlatformAudioUnit::Audi
我关注了this使用 DataTables 插件启用多个表(在同一页上)。对于手动表,它可以工作,但对于动态创建的表,它显示以下错误: Uncaught TypeError: Cannot read
我正在努力掌握 jQuery 数据表(v1.10.1,通过 CDN)以及当前版本中使用的约定。各种文档充其量在“完整”示例中令人困惑/缺乏,在最坏的情况下相互冲突。 请解释当前 (v1.10.1) 关
我有一个数据表,它是通过 aoColumns 和 mData 生成和填充的 var dtable = $('.ssdatatable').DataTable({ //list of datat
我正在尝试使用 jQuery Datatable 插件在 HTML 页面中进行分页。 Clients Clients Clients Number of S
我正在使用数据表来显示来自服务器的数据。问题是我在控制台中不断收到错误消息: datatables.min.js:145 Uncaught TypeError: 无法读取未定义的属性“mData” 我
我已将数据表绑定(bind)到 ASP.Net 中的 gridview。我尝试使用 jQuery dataTable 在 gridview 中显示搜索和排序选项,但数据表向我抛出错误。 错误是:未捕获
我使用以下 HTML 表使用 jquery 数据表进行分页 Image Code Weight Jarti
我在 AudioBuffer 中有某些数据(来自录音)。在将此缓冲区写入文件之前,我想对 PCM 样本做一些处理。如何像使用 fread 读取一样从 AudioBuffer 的 mData 字段中读取
因此,我在使用 php 从数据库迭代的一大组行上收到控制台错误。我正在用 metronic 主题初始化它。正如你所看到的,我有我的头部和 body 。 我怀疑问题可能与输出的大小有关,并且可能需要使用
NDK 文档说此函数可用 ( https://developer.android.com/ndk/reference/group/media#group___media_1ga8eb3e60bb5c7
我是一名优秀的程序员,十分优秀!