我目前使用的是:
jQuery JavaScript库v2.2.4 jQuery UI - v1.12.0 - 2016-07-08
我使用了以下代码来初始化该表
<!-- Datatables Scripts -->
<script src="js/jquery.dataTables.js"></script>
<script src="js/jquery.dataTables.yadcf.js"></script>
<script type="application/javascript">
$(document).ready(function() {
addTest();
var testTable;
testTable = $('#datatable').DataTable({
stateSave: true,
orderable: true,
'order': [[ 0, 'desc' ]],
searching: false
});
yadcf.init(testTable, [{
column_number: 1
}]);
});
</script>当我加载页面时,我希望让筛选器显示的列,下拉列表中有值。但是,当我在下拉列表中选择一项时,什么也没有发生。它显示它已被选中,仅此而已。我使用的jQuery和jQuery-UI是否存在问题,导致不能刷新表?这正是我需要的。如果有必要的话,我也在使用twitter bootstrap。我还访问了dataTables站点,并将所有内容都包含在一个文件中,包括这些文件。dataTables本身可以工作并显示,但它是过滤器下拉菜单,而不是实际刷新表格。谢谢!
发布于 2017-03-15 00:29:48
看来我把这个贴到了quick上。看了一遍又一遍,我发现我关闭了搜索。删除了搜索: false,它现在可以工作了。最初,我关闭了搜索,因为搜索框在移动设备上运行得不好。
发布于 2018-01-06 06:45:26
对于那些想在没有搜索栏的情况下过滤yadcf的人,不能只禁用排序。我找到的解决方案是将搜索值保持为true (默认值),并使用dom:初始化参数跳过(F)过滤选项。
例如)
$('#tableId').DataTable({
dom: 'Bti',
//Note, this maintains (B)uttons, then the (t)able, then the (i)nfo section - skipping the (l)ength, (f)iltering, (p)agination, and p(r)ocessing which I didn't want.
// ... other initialization ...
});https://stackoverflow.com/questions/42791360
复制相似问题