【发布时间】:2015-08-28 23:12:48
【问题描述】:
我正在使用 jQuery 的数据表插件。我正在关注许多人使用的link's 方法;但是,我没有获得用于搜索每一列的文本框,而是在右上角获得了一个普通的文本附加列和原始搜索文本框以及显示条目保管箱正在消失。知道为什么会这样吗?
感谢任何帮助。
更新(代码)
<table id="g_table" class="table table-responsive table-bordered table-striped table-hover">
<thead>
<tr>
<th>@Html.DisplayNameFor(model => model.date_time) (mm/dd/yyyy hh:mm:ss)</th>
<th>@Html.DisplayNameFor(model => model.value_level)</th>
<th>@Html.DisplayNameFor(model => model.alert_status)</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.date_time)
</td>
<td>
@Html.DisplayFor(modelItem => item.value_level)
</td>
<td>
@Html.DisplayFor(modelItem => item.alert_status)
</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<th>Date and Time</th>
<th>Level</th>
<th>Alert Status</th>
</tr>
</tfoot>
</table>
<script src="~/Scripts/DataTables/jquery.dataTables.min.js"></script>
<script src="~/Scripts/Highcharts-4.0.1/js/highcharts.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#g_table").dataTable().columnFilter();
});
</script>
【问题讨论】:
-
需要查看您的代码以及您使用的 jQuery / DataTables 版本
-
@psalmody 我已经更新了我的问题并添加了代码
标签: jquery datatable filtering