我正在使用 Yajrabox Laravel 数据表来显示数据。非常简单,只需尝试教程中给出的内容。但是,在表的页脚中输入的文本框没有显示出来。
https://datatables.yajrabox.com/eloquent/multi-filter-select
使用页面中的相同代码 - 源代码。
$('#users-table').DataTable({
processing: true,
serverSide: true,
ajax: 'https://datatables.yajrabox.com/eloquent/multi-filter-select-data',
columns: [
{data: 'id', name: 'id'},
{data: 'name', name: 'name'},
{data: 'email', name: 'email'},
{data: 'created_at', name: 'created_at'},
{data: 'updated_at', name: 'updated_at'}
],
initComplete: function () {
this.api().columns().every(function () {
var column = this;
var input = document.createElement("input");
$(input).appendTo($(column.footer()).empty())
.on('change', function () {
column.search($(this).val(), false, false, true).draw();
});
});
}
});
数据表按预期显示,列和数据、排序和搜索功能位于表顶部。
但是,页脚不显示过滤器框,而过滤器框应该显示在示例中。
我不确定我错过了什么。如果有人能指出我正确的方向,那将很有帮助。