Php Datatables单个列筛选不起作用

Php Datatables单个列筛选不起作用,php,jquery,datatable,datatables,input-filtering,Php,Jquery,Datatable,Datatables,Input Filtering,感谢Stryner的代码 这正是我想要的 但是,如果底部的第四个单元格在需要的地方显示输入,在模糊/更改/设置关键帧时,什么都不会发生 控制台:未定义不是一个函数 -对应于“oTable.columns().eq(0).each(函数(colIdx){” 你能帮我解决这个问题吗 (谢谢你) $(“#datos tfoot th”)。不(“:eq(0),:eq(3),:eq(5),:eq(6)”//排除第0、3、5和6列 .每个(功能) { var title=$('#示例thead th').e

感谢Stryner的代码

这正是我想要的

但是,如果底部的第四个单元格在需要的地方显示输入,在模糊/更改/设置关键帧时,什么都不会发生

控制台:未定义不是一个函数 -对应于“oTable.columns().eq(0).each(函数(colIdx){”

你能帮我解决这个问题吗

(谢谢你)

$(“#datos tfoot th”)。不(“:eq(0),:eq(3),:eq(5),:eq(6)”//排除第0、3、5和6列
.每个(功能)
{
var title=$('#示例thead th').eq($(this.index()).text();
$(this.html(“”);
});
变量oTable=$('#datos').dataTable();
oTable.columns().eq(0).each(函数(colIdx){
如果(colIdx==0 | | colIdx==3 | | colIdx==5 | | colIdx==6)返回;//不要为这些列添加事件处理程序
$('input',table.column(colIdx).footer()).on('keyup blur change',function(){oTable
.列(colIdx)
.search(this.value)
.draw();
});
}); 
我的服务器端脚本与页面底部的脚本相同


谢谢

请为您的keyup事件尝试此功能,并让我知道它是否有效。我很久以前就使用过此功能,因此无法确定它是否适用于您,但它可能有帮助:

$("tfoot input").keyup( function () {
        /* Filter on the column (the index) of this element */
        oTable.fnFilter( this.value, $("tfoot input").index(this) );
    } );

这似乎可以正常工作。请检查此处:。您可能希望检查jQuery版本或html表是否设置正确。这根本不起作用。底部搜索输入显示正确,但在我键入内容时没有进行筛选。此外,在控制台中,我读取的未定义内容不是一个函数,我在jQuery t方面做得不够好o我自己解决它…我不知道。请帮我:)检查一下datatable 1.10版本中的这个链接。感谢你的链接。我遵循了第一个示例中给出的代码,但我再次陷入困境:要么使用$query.=JOIN,要么在我的“PostCode City”列中。我得到
{“draw”:1,“recordsTotal”:16,“recordsFiltered”:0,“data:[]}
…谢谢,我一个星期以来一直在使用数据库,尝试了这么多的代码和公式,我都快疯了/沮丧了/病倒了,无法让它正常工作。谢谢你的帮助:)不幸的是,它仍然不起作用。
$("tfoot input").keyup( function () {
        /* Filter on the column (the index) of this element */
        oTable.fnFilter( this.value, $("tfoot input").index(this) );
    } );