【发布时间】:2015-09-18 17:38:11
【问题描述】:
我一直在尝试在过滤后获取表格的行数,但我什至无法让它最初回复行数。
我的表格通过 HTML5 呈现并由 PHP 填充,一切正常。
<table id="table_books" class="table datatable" data-searchplaceholder="Search books..." data-margindifference="70" >
<thead>
<tr>
<th style="width:30px;"><i class="fa fa-code" title="click"></i></th>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
<th class="text-right hidden-xs" style="width:20%">Details</th>
</tr>
</thead>
<tbody>
<?php echo $contenthtml; ?>
</tbody>
</table>
我发现文档说这在 1.9 中有效,但我得到一个无效的函数
$(document).ready(function() {
var btable = $('#table_books').DataTable();
var b_table_count = btable._('tr', {"filter":"applied"});
console.log(b_table_count);
});
【问题讨论】:
标签: javascript php html datatables