为什么对于一个手机号码,这个数据表没有显示任何结果
Why is this datatable showing no result when for a mobile number?
我有一个数据表,我将把数据放在其中。您可以看到下面的代码。我想让你注意到这一点;代码现在就可以完美工作了。但是,当您从代码&然后尝试使用配置文件id(8或12)进行搜索;它不会像没有手机号码时那样显示记录。我想知道为什么。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.10/css/jquery.dataTables.min.css">
<script src="https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js"></script>
<script>
$(function() {
$(".datatable").DataTable();
});
</script>
<table class="datatable table table-bordered table-striped">
<thead>
<tr>
<th>Profile id</th>
<th>Name</th>
<th>Surname</th>
<!-- <th>Mobile#</th>-->
</tr>
</thead>
<tfoot>
<tr>
<th>Profile id</th>
<th>Name</th>
<th>Surname</th>
<!-- <th>Mobile#</th>-->
</tr>
</tfoot>
<tbody>
<tr>
<td>1</td>
<td>John</td>
<td>Keller</td>
<!--<td>12123123</td>-->
</tr>
<tr>
<td>2</td>
<td>Donald</td>
<td>Duck</td>
<!-- <td>12123123</td>-->
</tr>
</tbody>
</table>
Fiddle链接…:Fiddle链接
这对我有效。我在Chrome中看不到任何问题,至少在中是这样
我可以搜索电话1,2,3和id 8来找到John,电话4,5,6和id 9来找到Duck
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.10/css/jquery.dataTables.min.css">
<script src="https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js"></script>
<script>
$(function() {
$(".datatable").DataTable();
});
</script>
<table class="datatable table table-bordered table-striped">
<thead>
<tr>
<th>Profile id</th>
<th>Name</th>
<th>Surname</th>
<th>Mobile#</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Profile id</th>
<th>Name</th>
<th>Surname</th>
<th>Mobile#</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>8</td>
<td>John</td>
<td>Keller</td>
<td>123</td>
</tr>
<tr>
<td>9</td>
<td>Donald</td>
<td>Duck</td>
<td>456</td>
</tr>
</tbody>
</table>
如果搜索字段包含该值,那么它似乎会在所有td元素中进行搜索,是否可能为此使用正则表达式?
我还没有使用过DataTables,但有没有办法设置它应该签入哪个字段?那很可能会解决你的问题。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.10/css/jquery.dataTables.min.css">
<script src="https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js"></script>
<script>
$(function() {
$(".datatable").DataTable();
});
</script>
<table class="datatable table table-bordered table-striped">
<thead>
<tr>
<th>Profile id</th>
<th>Name</th>
<th>Surname</th>
<th>Mobile#</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Profile id</th>
<th>Name</th>
<th>Surname</th>
<th>Mobile#</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>1</td>
<td>John</td>
<td>Keller</td>
<td>12123123</td>
</tr>
<tr>
<td>2</td>
<td>Donald</td>
<td>Duck</td>
<td>23232323</td>
</tr>
</tbody>
</table>
相关文章:
- D3.js生成有效的SVG,但不显示任何内容
- HTML 5 和 3.js 代码不会在网页上显示任何内容
- jquery Ajax没有;不要显示任何信息(既不显示成功也不显示失败)
- javascript函数,该函数不起作用,但不会显示任何错误
- JavaScript 未显示任何警报对话框
- 谷歌地图没有显示任何标记
- 没有使用Highcharts显示任何图形
- jQuery导航下拉菜单未显示..任何想法
- AngularJS:console.log不显示任何内容
- ng-repeat不显示任何内容
- ng-重复不显示任何内容
- extjs在chrome中可以正常工作;不要在firefox或ie中显示任何内容
- 使用javascript在标签上不显示任何内容
- console.log在FF插件生成器中没有显示任何内容
- TypeAhead.js没有显示任何输出Rails
- 使用ajax运行php脚本不会显示任何结果
- 我的Javascript项目正在访问网络摄像头,但没有显示任何内容
- 日期-时间范围指令字段未显示任何值
- owl.carousel help-没有显示任何东西
- PhoneGap-Javascript没有显示任何响应